This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Java » Java in General
Bookmark "compilation problem with inner classes" Watch "compilation problem with inner classes" New topic

compilation problem with inner classes

Vijay Gade
Ranch Hand

Joined: Jul 04, 2005
Posts: 81

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

Joined: Jul 08, 2003
Posts: 24189

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

TopClass.InnerClass something = tlcObj.makeInnerInst();
TopClass.InnerClass somethingElse = 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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: compilation problem with inner classes
It's not a secret anymore!