File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes compilation problem with inner classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "compilation problem with inner classes" Watch "compilation problem with inner classes" New topic
Author

compilation problem with inner classes

Vijay Gade
Ranch Hand

Joined: Jul 04, 2005
Posts: 81
Hello,

In the following code, please help in finding the error. I get a compilation error at lines 16 and 17.

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Both lines are wrong in multiple ways. The following lines are correct:

TopClass.InnerClass something = tlcObj.makeInnerInst();
TopClass.InnerClass somethingElse = tlcObj.new InnerClass();


[Jess in Action][AskingGoodQuestions]
Vijay Gade
Ranch Hand

Joined: Jul 04, 2005
Posts: 81
Yes I just realized while taking another look into my code that I did not, foolishly of course, define an object. Thank you very much for your reply, and I am sorry for having wasted your valuable time on such a silly mistake. Please excuse me.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: compilation problem with inner classes