際際滷

際際滷Share a Scribd company logo
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:
i. DEFAULT
ii.PRIVATE
iii.PROTECTED
iv.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
Access specifiers(modifiers) in java

More Related Content

What's hot (20)

This keyword in java
This keyword in javaThis keyword in java
This keyword in java
Hitesh Kumar
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
Vinod Kumar
Super keyword in java
Super keyword in javaSuper keyword in java
Super keyword in java
Hitesh Kumar
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
International Institute of Information Technology (I族IT)
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
Pooja Jaiswal
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
Constructor in java
Constructor in javaConstructor in java
Constructor in java
Pavith Gunasekara
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
VINOTH R
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
HalaiHansaika
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
kamal kotecha
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Paumil Patel
Packages in java
Packages in javaPackages in java
Packages in java
Elizabeth alexander
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
Amar Jukuntla
Applets in java
Applets in javaApplets in java
Applets in java
Wani Zahoor
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
Nilesh Dalvi
Java Data Types
Java Data TypesJava Data Types
Java Data Types
Spotle.ai
Java threads
Java threadsJava threads
Java threads
Prabhakaran V M
Super Keyword in Java.pptx
Super Keyword in Java.pptxSuper Keyword in Java.pptx
Super Keyword in Java.pptx
KrutikaWankhade1
Inheritance in OOPS
Inheritance in OOPSInheritance in OOPS
Inheritance in OOPS
Ronak Chhajed
This keyword in java
This keyword in javaThis keyword in java
This keyword in java
Hitesh Kumar
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
Vinod Kumar
Super keyword in java
Super keyword in javaSuper keyword in java
Super keyword in java
Hitesh Kumar
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
Pooja Jaiswal
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
VINOTH R
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
HalaiHansaika
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
kamal kotecha
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Paumil Patel
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
Amar Jukuntla
Applets in java
Applets in javaApplets in java
Applets in java
Wani Zahoor
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
Nilesh Dalvi
Java Data Types
Java Data TypesJava Data Types
Java Data Types
Spotle.ai
Super Keyword in Java.pptx
Super Keyword in Java.pptxSuper Keyword in Java.pptx
Super Keyword in Java.pptx
KrutikaWankhade1
Inheritance in OOPS
Inheritance in OOPSInheritance in OOPS
Inheritance in OOPS
Ronak Chhajed

Similar to Access specifiers(modifiers) in java (20)

Access modifiers in java
Access modifiers in javaAccess modifiers in java
Access modifiers in java
Ashwin Thadani
Access modifier and inheritance
Access modifier and inheritanceAccess modifier and inheritance
Access modifier and inheritance
Dikshyanta Dhungana
C# Access modifiers
C# Access modifiersC# Access modifiers
C# Access modifiers
Prem Kumar Badri
Access Modifiers in Java.pptx
 Access Modifiers in Java.pptx Access Modifiers in Java.pptx
Access Modifiers in Java.pptx
sarthakgithub
Access Modifiers .pptx
Access Modifiers .pptxAccess Modifiers .pptx
Access Modifiers .pptx
MDRakibKhan3
Java modifiers
Java modifiersJava modifiers
Java modifiers
Soba Arjun
Access modifiers in java
Access modifiers in javaAccess modifiers in java
Access modifiers in java
Muthukumaran Subramanian
Visibility Modifiers for Access Control.pptx
Visibility Modifiers for Access Control.pptxVisibility Modifiers for Access Control.pptx
Visibility Modifiers for Access Control.pptx
naazminshaikh1727
D2 Object Oriented Programming
D2 Object Oriented ProgrammingD2 Object Oriented Programming
D2 Object Oriented Programming
Pakorn Weecharungsan
Access Protection
Access ProtectionAccess Protection
Access Protection
myrajendra
Access Modifier.pptx
Access Modifier.pptxAccess Modifier.pptx
Access Modifier.pptx
Margaret Mary
Lecture 8
Lecture 8Lecture 8
Lecture 8
Debasish Pratihari
Power point presentation on access specifier in OOPs
Power point presentation on access specifier in OOPsPower point presentation on access specifier in OOPs
Power point presentation on access specifier in OOPs
AdrizaBera
How totestinternalprotectmethodsinc#
How totestinternalprotectmethodsinc#How totestinternalprotectmethodsinc#
How totestinternalprotectmethodsinc#
LearningTech
Access Modifiers To set the access levels of variables,methods (mem.pdf
Access Modifiers To set the access levels of variables,methods (mem.pdfAccess Modifiers To set the access levels of variables,methods (mem.pdf
Access Modifiers To set the access levels of variables,methods (mem.pdf
sanjeevtandonsre
Unit-4 Day1.pptx
Unit-4 Day1.pptxUnit-4 Day1.pptx
Unit-4 Day1.pptx
Revathiparamanathan
3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx
carold12
Oops (inheritance&interface)
Oops (inheritance&interface)Oops (inheritance&interface)
Oops (inheritance&interface)
Muthukumaran Subramanian
web programmimg ppt which is about the java packages
web programmimg ppt which is about the java packagesweb programmimg ppt which is about the java packages
web programmimg ppt which is about the java packages
ahmadsania2004
27c
27c27c
27c
Sireesh K
Access modifiers in java
Access modifiers in javaAccess modifiers in java
Access modifiers in java
Ashwin Thadani
Access modifier and inheritance
Access modifier and inheritanceAccess modifier and inheritance
Access modifier and inheritance
Dikshyanta Dhungana
Access Modifiers in Java.pptx
 Access Modifiers in Java.pptx Access Modifiers in Java.pptx
Access Modifiers in Java.pptx
sarthakgithub
Access Modifiers .pptx
Access Modifiers .pptxAccess Modifiers .pptx
Access Modifiers .pptx
MDRakibKhan3
Java modifiers
Java modifiersJava modifiers
Java modifiers
Soba Arjun
Visibility Modifiers for Access Control.pptx
Visibility Modifiers for Access Control.pptxVisibility Modifiers for Access Control.pptx
Visibility Modifiers for Access Control.pptx
naazminshaikh1727
Access Protection
Access ProtectionAccess Protection
Access Protection
myrajendra
Access Modifier.pptx
Access Modifier.pptxAccess Modifier.pptx
Access Modifier.pptx
Margaret Mary
Power point presentation on access specifier in OOPs
Power point presentation on access specifier in OOPsPower point presentation on access specifier in OOPs
Power point presentation on access specifier in OOPs
AdrizaBera
How totestinternalprotectmethodsinc#
How totestinternalprotectmethodsinc#How totestinternalprotectmethodsinc#
How totestinternalprotectmethodsinc#
LearningTech
Access Modifiers To set the access levels of variables,methods (mem.pdf
Access Modifiers To set the access levels of variables,methods (mem.pdfAccess Modifiers To set the access levels of variables,methods (mem.pdf
Access Modifiers To set the access levels of variables,methods (mem.pdf
sanjeevtandonsre
3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx3) Distinguish among various methods to implement access controlsSolut.docx
3) Distinguish among various methods to implement access controlsSolut.docx
carold12
web programmimg ppt which is about the java packages
web programmimg ppt which is about the java packagesweb programmimg ppt which is about the java packages
web programmimg ppt which is about the java packages
ahmadsania2004

Recently uploaded (20)

KCS Whitepaper - A Blockchain-Based Value Self-Circulation Ecosystem
KCS Whitepaper - A Blockchain-Based Value Self-Circulation EcosystemKCS Whitepaper - A Blockchain-Based Value Self-Circulation Ecosystem
KCS Whitepaper - A Blockchain-Based Value Self-Circulation Ecosystem
KuCoin - Exchange
Your paragraph text_20250307_191630_0000.pdf
Your paragraph text_20250307_191630_0000.pdfYour paragraph text_20250307_191630_0000.pdf
Your paragraph text_20250307_191630_0000.pdf
jatv64344
JARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGE
JARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGEJARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGE
JARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGE
Jarinzo Tanabata
HUM102_際際滷s_Lecture01.pptx Report Writting Skills
HUM102_際際滷s_Lecture01.pptx Report Writting SkillsHUM102_際際滷s_Lecture01.pptx Report Writting Skills
HUM102_際際滷s_Lecture01.pptx Report Writting Skills
ibrahimzahid201
AI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbv
AI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbvAI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbv
AI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbv
xdlmao561
2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx
2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx
2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx
Dale Wells
Defining what is or is not academic writing.pptx
Defining what is or is not academic writing.pptxDefining what is or is not academic writing.pptx
Defining what is or is not academic writing.pptx
bluerosedreamland
TRADE PROMOTION UNIT action plan version 3.pptx
TRADE PROMOTION UNIT action plan version 3.pptxTRADE PROMOTION UNIT action plan version 3.pptx
TRADE PROMOTION UNIT action plan version 3.pptx
SupunLiyanage5
SEO Myths You Should Stop Believing in 2025.pdf
SEO Myths You Should Stop Believing in 2025.pdfSEO Myths You Should Stop Believing in 2025.pdf
SEO Myths You Should Stop Believing in 2025.pdf
Md Emran Hossain
AI in Parliaments: Strategic Opportunities and Challenges
AI in Parliaments: Strategic Opportunities and ChallengesAI in Parliaments: Strategic Opportunities and Challenges
AI in Parliaments: Strategic Opportunities and Challenges
Dr. Fotios Fitsilis
Cerino Four Seasons 300th Anniversary x China
Cerino Four Seasons 300th Anniversary x ChinaCerino Four Seasons 300th Anniversary x China
Cerino Four Seasons 300th Anniversary x China
Marco Acerbi
Mavi Gradyan Profesyonel Kurumsal Sunum (1).pdf
Mavi Gradyan Profesyonel Kurumsal Sunum (1).pdfMavi Gradyan Profesyonel Kurumsal Sunum (1).pdf
Mavi Gradyan Profesyonel Kurumsal Sunum (1).pdf
efeaudal4599
Steven Nickel Seeing God 3.09.2025.pptx
Steven  Nickel Seeing God 3.09.2025.pptxSteven  Nickel Seeing God 3.09.2025.pptx
Steven Nickel Seeing God 3.09.2025.pptx
FamilyWorshipCenterD
Grey's Anatomy Trivia - The Coffee Parlor
Grey's Anatomy Trivia - The Coffee ParlorGrey's Anatomy Trivia - The Coffee Parlor
Grey's Anatomy Trivia - The Coffee Parlor
sdwebb2000
Profisee - HIMSS workshop - Mar 2025 - final.pptx
Profisee - HIMSS workshop - Mar 2025 - final.pptxProfisee - HIMSS workshop - Mar 2025 - final.pptx
Profisee - HIMSS workshop - Mar 2025 - final.pptx
Profisee
FIFA Friendly Match at Alberni Valley - Strategic Plan.pptx
FIFA Friendly Match at Alberni Valley - Strategic Plan.pptxFIFA Friendly Match at Alberni Valley - Strategic Plan.pptx
FIFA Friendly Match at Alberni Valley - Strategic Plan.pptx
abuhasanjahangir
AI Safety in Parliaments: Latest Standards and Compliance Challenges
AI Safety in Parliaments: Latest Standards and Compliance ChallengesAI Safety in Parliaments: Latest Standards and Compliance Challenges
AI Safety in Parliaments: Latest Standards and Compliance Challenges
Dr. Fotios Fitsilis
Science Communication beyond Journal Publications Workshop
Science Communication beyond Journal Publications WorkshopScience Communication beyond Journal Publications Workshop
Science Communication beyond Journal Publications Workshop
WAIHIGA K.MUTURI
day 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATE
day 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATEday 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATE
day 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATE
MefetchMoevaGumahad
Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)
Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)
Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)
RonHawkes1
KCS Whitepaper - A Blockchain-Based Value Self-Circulation Ecosystem
KCS Whitepaper - A Blockchain-Based Value Self-Circulation EcosystemKCS Whitepaper - A Blockchain-Based Value Self-Circulation Ecosystem
KCS Whitepaper - A Blockchain-Based Value Self-Circulation Ecosystem
KuCoin - Exchange
Your paragraph text_20250307_191630_0000.pdf
Your paragraph text_20250307_191630_0000.pdfYour paragraph text_20250307_191630_0000.pdf
Your paragraph text_20250307_191630_0000.pdf
jatv64344
JARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGE
JARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGEJARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGE
JARINZO TANABATAS SIX CAPITAL FORCES: A FRAMEWORK FOR STRATEGIC ADVANTAGE
Jarinzo Tanabata
HUM102_際際滷s_Lecture01.pptx Report Writting Skills
HUM102_際際滷s_Lecture01.pptx Report Writting SkillsHUM102_際際滷s_Lecture01.pptx Report Writting Skills
HUM102_際際滷s_Lecture01.pptx Report Writting Skills
ibrahimzahid201
AI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbv
AI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbvAI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbv
AI PRESENTATION.pptxfvvvvvvvvvvhbbbvvbbv
xdlmao561
2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx
2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx
2025-03-02 FATC 01 Annas, Caiaphas & The Sanhedrin (shared slides).pptx
Dale Wells
Defining what is or is not academic writing.pptx
Defining what is or is not academic writing.pptxDefining what is or is not academic writing.pptx
Defining what is or is not academic writing.pptx
bluerosedreamland
TRADE PROMOTION UNIT action plan version 3.pptx
TRADE PROMOTION UNIT action plan version 3.pptxTRADE PROMOTION UNIT action plan version 3.pptx
TRADE PROMOTION UNIT action plan version 3.pptx
SupunLiyanage5
SEO Myths You Should Stop Believing in 2025.pdf
SEO Myths You Should Stop Believing in 2025.pdfSEO Myths You Should Stop Believing in 2025.pdf
SEO Myths You Should Stop Believing in 2025.pdf
Md Emran Hossain
AI in Parliaments: Strategic Opportunities and Challenges
AI in Parliaments: Strategic Opportunities and ChallengesAI in Parliaments: Strategic Opportunities and Challenges
AI in Parliaments: Strategic Opportunities and Challenges
Dr. Fotios Fitsilis
Cerino Four Seasons 300th Anniversary x China
Cerino Four Seasons 300th Anniversary x ChinaCerino Four Seasons 300th Anniversary x China
Cerino Four Seasons 300th Anniversary x China
Marco Acerbi
Mavi Gradyan Profesyonel Kurumsal Sunum (1).pdf
Mavi Gradyan Profesyonel Kurumsal Sunum (1).pdfMavi Gradyan Profesyonel Kurumsal Sunum (1).pdf
Mavi Gradyan Profesyonel Kurumsal Sunum (1).pdf
efeaudal4599
Steven Nickel Seeing God 3.09.2025.pptx
Steven  Nickel Seeing God 3.09.2025.pptxSteven  Nickel Seeing God 3.09.2025.pptx
Steven Nickel Seeing God 3.09.2025.pptx
FamilyWorshipCenterD
Grey's Anatomy Trivia - The Coffee Parlor
Grey's Anatomy Trivia - The Coffee ParlorGrey's Anatomy Trivia - The Coffee Parlor
Grey's Anatomy Trivia - The Coffee Parlor
sdwebb2000
Profisee - HIMSS workshop - Mar 2025 - final.pptx
Profisee - HIMSS workshop - Mar 2025 - final.pptxProfisee - HIMSS workshop - Mar 2025 - final.pptx
Profisee - HIMSS workshop - Mar 2025 - final.pptx
Profisee
FIFA Friendly Match at Alberni Valley - Strategic Plan.pptx
FIFA Friendly Match at Alberni Valley - Strategic Plan.pptxFIFA Friendly Match at Alberni Valley - Strategic Plan.pptx
FIFA Friendly Match at Alberni Valley - Strategic Plan.pptx
abuhasanjahangir
AI Safety in Parliaments: Latest Standards and Compliance Challenges
AI Safety in Parliaments: Latest Standards and Compliance ChallengesAI Safety in Parliaments: Latest Standards and Compliance Challenges
AI Safety in Parliaments: Latest Standards and Compliance Challenges
Dr. Fotios Fitsilis
Science Communication beyond Journal Publications Workshop
Science Communication beyond Journal Publications WorkshopScience Communication beyond Journal Publications Workshop
Science Communication beyond Journal Publications Workshop
WAIHIGA K.MUTURI
day 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATE
day 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATEday 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATE
day 4- w3-q4 ppt FACTORS THAT AFFECT WEATHER CLIMATE
MefetchMoevaGumahad
Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)
Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)
Heraldry Gold's Whiteburn Gold Project (PDAC, March 2025)
RonHawkes1

Access specifiers(modifiers) in java

  • 1. ACCESS SPECIFIERS(MODIFIERS) IN JAVA PRESENTED BY : HRITHIK SHINDE PRAJWAL POOJARI MANNU VISHWAKARMA
  • 2. 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
  • 3. . THERE ARE 4 TYPES OF JAVA ACCESS SPECIFIERS: i. DEFAULT ii.PRIVATE iii.PROTECTED iv.PUBLIC
  • 4. . 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.
  • 5. .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.
  • 6. .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.
  • 7. .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.
  • 8. 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