File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

outerInstance.new InnerClass[] { };

 
Garrett Smith
Ranch Hand
Posts: 401
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Garrett Smith
Ranch Hand
Posts: 401
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic