This link has been bookmarked by 20 people . It was first bookmarked on 18 Sep 2007, by someone privately.
-
19 Jun 11
-
06 Apr 11
-
The member class is the only class that you can declare static.
-
top-level class
-
-
03 Sep 10
-
: top-level classes and inner classes.
-
. Each top-level class corresponds to its own java file sporting the same name as the class name.
-
A top-level class is by definition already top-level, so there is no point in declaring it static; it is an error to do so.
-
Because an anonymous class doesn't have a normal class declaration where it's possible to use
static -
, it cannot be declared
-
static
-
Like local variables, local classes aren't allowed to be declared public, protected, private, or static
-
You declare member classes when you want to use variables and methods of the containing class without explicit delegation.
-
When you declare a member class, you can instantiate that member class only within the context of an object of the outer class in which this member class is declared. If you want to remove this restriction, you declare the member class a static class.
-
The member class is the only class that you can declare static
-
hen you declare a member class with a
staticmodifier, it becomes a nested top-level class and can be used as a normal top-level class as explained above -
nested top-level class is a member classes with a
staticmodifier. A nested top-level class is just like any other top-level class except that it is declared within another class or interface. Nested top-level classes are typically
-
-
28 Jul 10
-
The member class is the only class that you can declare static. When you declare a member class, you can instantiate that member class only within the context of an object of the outer class in which this member class is declared. If you want to remove this restriction, you declare the member class a static class.
When you declare a member class with a
staticmodifier, it becomes a nested top-level class and can be used as a normal top-level class as explained above.
-
-
11 May 10
-
22 Mar 10
-
29 Jan 10
-
05 Nov 08
-
13 Aug 08
-
09 Aug 08
-
14 Aug 06
-
09 Aug 05
-
Can a class -- inner or outer -- be declared static?
-
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.