0% found this document useful (0 votes)
38 views1 page

Access Specifier

There are four access specifiers in Java - public, default, protected, and private. Public access is the most accessible and has scope throughout the entire project. Default access has no keyword and applies to members without a specified access, its scope is within the package. Protected access applies within the package but allows access by subclasses outside the package if inheritance occurs. Private access is the most restrictive, only accessible within its own class.

Uploaded by

priya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views1 page

Access Specifier

There are four access specifiers in Java - public, default, protected, and private. Public access is the most accessible and has scope throughout the entire project. Default access has no keyword and applies to members without a specified access, its scope is within the package. Protected access applies within the package but allows access by subclasses outside the package if inheritance occurs. Private access is the most restrictive, only accessible within its own class.

Uploaded by

priya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#...

Access specifier :--

#.. there are four parts in AS..

1) Public
2) default
3) Protected
4) Private..

1) Public :--(Father) :-- the member declare with public keyword/Access


specifier is called as
Public ..
--- having scope through out of the project...

2) default :--
---- there is a no keyword to represent default access specifier..

--- the member declared without using AS are represent the syntax of default
AS..

---- the scope of default access specifier is within the package...

3) Protected :--

--- the member of a class declared with protected access specifier are having
scope of
within a package only..

--- but the class outside the package can also access protected members if
inheritance take
place...

4) Private :-- (child.)

--- the member of a class declare with private AS are having scope within a
class only..

You might also like