File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inner class " Watch "inner class " New topic
Author

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
Scope.

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
static variable inside function definition
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 modifier doubt