regards,
Arka
Arka Guhathakurta wrote:
2)Classes as sup and test cannot be declared as private or protected. Note that this type of class definitions may only be default or public.
The question is not clear to me. Adding final keyword before the class sup ensures that class sup cannot be inherited thus preventing override. I hope it clears your doubt.
SCJP 5
SCJP 5
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
<a href="http://eathumblepie.blogspot.com" target="_blank" rel="nofollow">http://eathumblepie.blogspot.com</a>
Maduranga Liyanage wrote:
Yes. In this context, it doesn;t matter if the method was static or not. The behavior is the same.
The protected methods can only accessed through a subclass instance if the class is in a different package if the method is non-static. But need not so when the method is static.
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
|