हिंदी

A private member method is only accessed: - Computer Applications

Advertisements
Advertisements

प्रश्न

A private member method is only accessed:

विकल्प

  • In the scope of the same class in which it is defined.

  • Anywhere outside the class in which it is defined.

  • In the derived class.

  • None of the above.

MCQ

उत्तर

In the scope of the same class in which it is defined.

Explanation:

In Java, private member methods are accessible only within the class in which they are declared. The private access modifier limits the method's visibility, preventing direct access from outside the class or from derived classes. 

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 8: Encapsulation and Inheritance - EXERCISES [पृष्ठ ४४४]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 8 Encapsulation and Inheritance
EXERCISES | Q I. 2. | पृष्ठ ४४४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×