Java - Things to know before your OCJP Exam - Classes and Interfaces

1. Default constructor initializes the primitives to their default values ( 0 for int , 0.0 for float etc ) and Instance variables to null.

2. Outer Class cannot be declared private or protected. It can only be either public or package protected ( default ).

3.  All members of Interfaces are intrinsically public.

4. * Members of the interface cannot be declared private.

5. * Variables of an interface are intrinsically public , static and final and can be accessed directly by the implementing class.

6. * An object is eligible for garbage collection when it looses all its references.

7. Last Reference assigned null doesn't make the object eligible for gc. Reference should be assigned to some other object.

8. System.gc doesn't enforce garbage collection immediately.

9. All wrapper classes are immutable.

10. * We don't need object of outer class for accessing static inner class object. Inner static class object can be initiated using outer Class name only.