PGDCA June 2022
POST GRADUATE DIPLOMA IN COMPUTER APPLICATIONS (NEW) (PGDCA (NEW))
Term-End Examination
June, 2022 MCS-206
OBJECT ORIENTED PROGRAMMING USING JAVA
1. (a) What are access specifiers? Explain the difference between public and private access specifiers in Java, with the help of an example.
Ans- Access specifiers in Java are keywords that define the visibility or accessibility of a class, method, or variable within a program. These specifiers help in controlling the scope of a class or its members, determining which parts of the code can access the declared elements.
In Java, there are three access specifiers: