nss
nss
Originally posted by Neha Sawant:
hey,
i am getting confused.
t.write(); is calling write method of test
Write method in process class is private and so it is not seen in subclass.
Then according to me write method of test class should be called ,please tell me where am i wrong.
thanx
nss
Originally posted by Neha Sawant:
So u mean to say the compiler will first check if write() is in
the Process class (yes it is) But since it is not accessible in Subclass so it is giving an error. Am i right?
But if the method was protected or with no access modifier then there would be no error and write() of subclass will be called.
nss
Then will the program execute without error.
SCJP2. Please Indent your code using UBB Code
nss
Honk if you love justice! And honk twice for tiny ads!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|