posted 23 years ago
is the access to protected methods outside their package be allowed to sub-subclasses too?
i mean, suppose i want to implement finalize() method of java.lang.Object and the class i am invoking it through is extending some other class, not Object directly. of course somewhere up the hierarchy its root is the Object. so does it have to declare explicitly the package as java.lang or not.
I have assumed that a class not extending another class can access the method without the package statement, coz such classes are implicitly assumed to directly extend Object.
Please comment.