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.
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 earthhttps://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter