wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes outerInstance.new InnerClass[] { }; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "outerInstance.new InnerClass[] { };" Watch "outerInstance.new InnerClass[] { };" New topic

outerInstance.new 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: http://jibbering.com/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: http://aspose.com/file-tools
subject: outerInstance.new InnerClass[] { };
Similar Threads
Certification4Career SCJP Mock Exam Errors??
Nested & Inner class
Have a question about inner class
How to call inner class method from static main() method - No static class
Inner Class