This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes InnerClass[] { }; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark " InnerClass[] { };" Watch " InnerClass[] { };" New topic
Author InnerClass[] { };

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
I want to declare an array of type InnerClass but I don't know how.

The program will compile if I use:
However, I will not be able to instatiate a new InnerClass[] from somewhere outside class OuterClass. I can get away with that here because InnerClass is in class scope.

This will not compile:

[ February 18, 2004: Message edited by: Garrett Smith ]

comp.lang.javascript FAQ:
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
OK. I think I figured it out.
With a array declaration, I specify the type, so OuterClass.InnerClass[].
It is sorta covered in the JavaRanch Style Guide.
subject: InnerClass[] { };
It's not a secret anymore!