What is static and a non-static inner class?

Answer Posted / karthee

Static inner class
can only access the static members of the enclosing class.
not associated with the instance of the enclosing class.
can only have static members.

Nonstatic class
is associated with the instance of the enclosing class.(we
need it first to access the nonstatic class)
can access all the member of the encosing class.
is like other members of the enclosing class.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is abstract class in Java?

875


What's the base class of all exception classes?

782


What are Normalization Rules? Define Normalization?

756


What exactly is methodology?

673


How do you represent a space in regex java?

724


What is matcher in java?

719


What is the difference between hashmap and hashtable in java?

764


What is structure of java heap? What is perm gen space in heap?

764


What are static blocks and static initalizers in java ?

772


Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?

820


What are packages in java?

885


Can we change the scope of the overridden method in the subclass?

1056


Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.

741


What do you mean by exception handling in Java?

972


What is the synonym of framework?

755