This ppt is about the Access Specifiers(Modifiers) in JAVA
This is short and understandable presentation to get to know about this topic
Size: 507.2 KB
Language: en
Added: Aug 19, 2018
Slides: 9 pages
Slide Content
Access Specifiers(modifiers) in java PRESENTED By : Hrithik Shinde Prajwal poojari Mannu vishwakarma
DEFINATION : ACCESS SPECIFIERS Access specifiers(or access modifiers) are keywords in object-oriented languages that sets the accessibility of the classes , methods and others members
. There are 4 types of java access specifiers: DEfault private Protected public
. 1]Default access specifier: No keyword is required to specify default access specifier When no access modifier is specified for a class, method or data member it is said to be having the default access specifier by default. Default access specifier are accessible within the same package.
. 2]Private access Specifier: The private access specifier is specified using the keyword private. The methods or data members declared as private are accessible only within the class in which they are declared. Any other class of same package will not be able to access these members. Classes or interface can not be declared as private.
. 3]Protected access specifier: The protected access specifier is specified using the keyword protected . The methods or data members declared as protected are accessible within same package or sub classes in different package.
. 4]Public access specifier: The public access specifier is specified using the keyword public . The public access specifier has the widest scope among all other access modifiers. Classes, methods or data members which are declared as public are accessible from every where in the program. There is no restriction on the scope of a public data members.
ACCESS LEVELS Specifier Class Package Subclass Everywhere Default Y Y N N Private Y N N N Protected Y Y Y N Public Y Y Y Y