| Author |
static
|
aryan sanghvi
Greenhorn
Joined: Jun 13, 2002
Posts: 21
|
|
can a static modifier be used for local variables. Inner class: If a class is defined in a method , it can access only final variables declared in a method, can it still access all the variables in the base class. Can an interface be instantiated.
|
 |
Anthony Villanueva
Ranch Hand
Joined: Mar 22, 2002
Posts: 1055
|
|
can a static modifier be used for local variables.
In C++ yes. In Java no. A local variable in Java has no "memory".
Inner class: If a class is defined in a method , it can access only final variables declared in a method, can it still access all the variables in the base class.
Base class? You mean enclosing class, right? It depends on the context of the method. If it is a static method, only static veriables can be accessed, else it can access both static and non-static.
Can an interface be instantiated.
No, but an object reference can be of an interface type.
|
 |
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
|
|
aryan, Welcome to Javaranch We'd like you to read the Javaranch Naming Policy and change your publicly displayed name to comply with our unique rule. Thank you.
|
SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
|
 |
 |
|
|
subject: static
|
|
|