I just want the differences on the basis of how members are accessible from enclosing class or from inner class of each other.
In relation to static, final, effectively final members and why?
A static nested class is effectively the same as using a separate class file except you put it inside another one.
If it is not static however it is called an inner class. The inner class has access to all members of its enclosing class. In case of a static nested class they can exist without the other being instantiated but an inner class can only exist within the instance of its enclosing class.
You should pay attention to the naming of the concepts. So in short:
public membrsThe official documentation explains this in detail so I suggest you should read through it. Information about local and anonymous inner classes can be found there as well.
static members, because of the absence of an intrinsic handle to an outer object. public has nothing to do with it.private members of the enclosing class are visible from the nested class, and likewise, private members of the nested class are visible to the outer class.
If the nested class is static, then only static members of the outer class may be seen, including private static.
You need an instance of the outer class in order to instantiate the nested class, unless the nested class is static. This makes sense - for non-static nested classes, you can only access the class definition of the nested class from an instance of the outer class, just as if it were a member variable.
As well as nested classes, there are also anonymous inner classes. These cannot be static, but clearly their scope is limited to the method in which they are defined.
inner class can't also be static. You need to talk about 'nested' rather than 'inner' in most of this.I just want the differences on the basis of how members are accessible from enclosing class or from inner class of each other.
There are no differences. Each can see all the other's members.
You didn't ask, but there is a difference if the enclosed class is static. A static nested class can only access the static members of the enclosing class. [It can 'see' the non-static members in terms of access control, but it has no intrinsic handle to an outer object so it has no way of accessing them.]
In relation to static, final, effectively final members and why?
This isn't even a sentence, let alone a question.