Home Help Java I Inner Classes In Java



Inner Classes In Java
Posted on: November 11, 2009 at 12:00 AM
There are 4 kind of classes that can be defined in a Java program, roughly can be termed as the inner classes.

Inner Classes In Java

     

There are 4 kind of classes that can be defined in a Java program, roughly can be termed as the inner classes.

--  Inner classes provides an elegant and powerful feature to the Java programming language. 
-- These inner classes are referred by different names in different situations. 

-- They are summarized here:
  1.
Static member classes
  2. Member classes
  3. Local classes
  4. Anonymous classes

-- The term "nested classes" sometimes refers to these inner classes.

Static member classes

  --
This class (or interface) is defined as a static member variable of another class.

Member classes

--  This is sometimes defined as a non-static member of an enclosing class. This type of inner class is analogous to an instance method or field.

Local classes

-- This class is defined within a block of Java code so like a local variable, it is visible only within that block.

Anonymous classes

-- An anonymous class is a  local class having no name; 
-- Syntactically it combines the syntax required for defining a class and the syntax required to instantiate an object. 

 

Related Tags for Inner Classes In Java:


More Tutorials from this section

Ask Questions?    Discuss: Inner Classes In Java  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.