aspose 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
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply 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: 24081
    
  15

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: compilation problem with inner classes
 
Similar Threads
Problem with generics
Nested & Inner class
overriding constructor of inner class
classes with private constructors can not be subclassed?