This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Good reading on inner/outer classes  RSS feed

Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I sent out a note to Paul Wheatson, who wrote, "Getting in Touch with your Inner Class". I found a typo and he asked me to post my reply here to get a discussion going... I think he just wants more people to read his article
Basically the typo states you can create an inner class with the following statement:
Inner i = new Outer().new Inner();
But the correct syntax is,
Outer.Inner i = new Outer().new Inner();
The only time you could use,
Inner i = new Outer().new Inner();
is if the statement was made from inside the outer class, not outside of it as he is doing from class TestMe.
For those of you who don't quite get inner and outer class, I suggest you read it, it can be found under the "Campfire" link on JavaRanch.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!