In nested class the variable and methods from the outer class can be invoked by the inner class. Whereas the variable and of inner class cannot be invoked by outer class.
Nested class is static class wrapped inside the outer class Inner class is non-static class wrapped inside the outer class which has access to the instance variables of outer class.
Using Inner classes you can write more efficient code and even reduce the typing work. Inner classes are frequently used in Event Handling. For example to MouseEvent event is handled in following example:
import java.applet.*; import java.awt.event.*; public class AnonymousInnerClassDemo extends Applet { public void init(){ addMouseListener( new MouseAdapter(){ public void mousePressed(MouseEvent me) { showStatus("mouse pressed"); } }); } }