wood burning stoves*
The moose likes Beginning Java and the fly likes inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inner class " Watch "inner class " New topic

inner class

prasanna pati
Ranch Hand

Joined: Jan 29, 2005
Posts: 46
Inner may be -> a class inside a class AND a class inside a method . So what is the difference between the two ?
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780

A class defined inside a method can access final variables, including local
ones. A member class can't access final local variables of a method.

Also, defining a local class inside a method gives the class name local
scope so that it can't be referenced elsewhere. It becomes an implementation
detail of the method.

There is no emoticon for what I am feeling!
I agree. Here's the link: http://aspose.com/file-tools
subject: inner class
Similar Threads
what is the need of writing an inner class inside an interface or abstract class
static members in inner classes
When can a classes be declared private?
static variable inside function definition
static modifier doubt