Method Declaration In Java, there 4 types of access specifiers. public : It is accessible in all classes in your application. private: It is accessible only within the class in which it is defined. default: It is declared/defined without using any modifier.7 Mar 2022