Here is the code.
public class Test {
class InnerClass{
}
public static void main(String[] args){
InnerClass ic
First, a "nested" class is static, and an "inner" class is not.
A static class is shared between all instances of the enclosing class (thus static fields are shared between all instances), while each instance has its own version of a non-static inner class.
Non-static inner classes are stored with the enclosing object (rather than class) and can only be accessed via an instance.