English

The most restrictive access specifier is ______.

Advertisements
Advertisements

Question

The most restrictive access specifier is ______.

Options

  • private

  • public

  • protected

  • default

MCQ
Fill in the Blanks
Advertisements

Solution

The most restrictive access specifier is private.

Explanation:

This is the most restrictive access modifier in Java. Any member (variable or method) marked as private can only be accessed within the exact same class in which it is declared. It is completely hidden from subclasses, other classes in the same package, and external packages.
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: User-Defined Methods - Exercises [Page 90]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 3 User-Defined Methods
Exercises | Q 1. (ii) | Page 90
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×