This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method local inner classes - conclusion

 
Faisal Ahmad
Ranch Hand
Posts: 355
Chrome Java Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inner classes are like a full fledged member of the enclosing class.
Similarly, can we conclude that a method-local inner class is like a local variable? Further, can we treat it like a local variable?
 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similarly, can we conclude that a method-local inner class is like a local variable? Further, can we treat it like a local variable?


Not sure what you mean by treating a inner class like a local variable. One is a class definition and the other is a reference variable. You can certain assign an instance of an method inner class to a local variable, but you can also assign this instance to a instance or class variable too (Although, in these later cases, you will need to hold it in a super class to the inner class, as the inner class type will not be in scope).

Henry
 
Faisal Ahmad
Ranch Hand
Posts: 355
Chrome Java Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops...it should've been 'local member'!
Sorry for the mistake.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic