| Author |
questions
|
Parameswaran Thangavel
Ranch Hand
Joined: Mar 01, 2005
Posts: 485
|
|
hi 1) can i say instance methods can only be overridden not hided.to hide a method it should be a class method(i.e declaring static).and for variable its not the cas 2) is the member interface(inte inside another intf) implicitly static.
|
 |
Mike Gershman
Ranch Hand
Joined: Mar 13, 2004
Posts: 1272
|
|
1) can i say instance methods can only be overridden not hided.to hide a method it should be a class method(i.e declaring static). Yes and for variable its not the case? Yes
If the class declares a field with a certain name, then the declaration of that field is said to hide any and all accessible declarations of fields with the same name in superclasses, and superinterfaces of the class. The field declaration also shadows (�6.3.1) declarations of any accessible fields in enclosing classes or interfaces, and any local variables, formal method parameters, and exception handler parameters with the same name in any enclosing blocks.
2) is the member interface(inte inside another intf) implicitly static? Yes.
Member interfaces are always implicitly static. It is permitted but not required for the declaration of a member interface to explicitly list the static modifier.
[ March 22, 2005: Message edited by: Mike Gershman ]
|
Mike Gershman
SCJP 1.4, SCWCD in process
|
 |
Parameswaran Thangavel
Ranch Hand
Joined: Mar 01, 2005
Posts: 485
|
|
The field declaration also shadows (�6.3.1) declarations of any accessible fields in enclosing classes or interfaces, and any local variables, formal method parameters, and exception handler parameters with the same name in any enclosing blocks. i didn't get this point
|
 |
 |
|
|
subject: questions
|
|
|