1. One java file , contain only one public outer class which is same name as file name . In one package may be multiple public class but in different – different file not in single file.
  2. private access specifier are accessible only in one class ( outer | Inner ) in which they defined not outside of these class.
  3. protected –> access any class in same package  OR  can access any child from another package which uses super class. ( Super class must be in package in which protected is defined)
  4. default –> Only access from class of same package.
  5. public –> Accessible from any class any package.
Advertisements