Question 136Asked in BPSC TRE 3.0 (2024) Computer Science Class 11-12

What is the access specifier used to make members of a class accessible only within the same package?

  1. Aprivate
  2. Bpublic
  3. Cpackage-private
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) package-private

Explanation

Java's default (package-private) access, with no modifier at all, makes a member visible only to classes in the same package.

From BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper

This is question 136 of BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.