"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
First, you can define a class within another class, but you can't define a class within a method (or constructor). So if you want the definition for Example2 to be nested inside Example1, then you'll need to move the Example2 definition outside of Example1's constructor.
Next, in the context of HelloWorldApp, the type "Example2" has no meaning. Instead, it needs to be "Example1.Example2" because Example2 is an inner class of Example1.
Next, constructors don't have return types. So "public Example2 Example1() {..." is not a constructor, and will not be called as part of creating an Example1 object. Instead, you should write a method to specifically return an instance of Example2, and then call that method.
James Carman, President<br />Carman Consulting, Inc.
Originally posted by James Carman:
... You can use anonymous inner classes if you wish within the body of a method/constructor.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org