This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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[].
I agree. Here's the link:
subject: InnerClass[] { };
Similar Threads
How to call inner class method from static main() method - No static class
Certification4Career SCJP Mock Exam Errors??
Inner Class
Nested & Inner class
Have a question about inner class