मराठी

Which of the following statements is the most appropriate for the private members? - Computer Applications

Advertisements
Advertisements

प्रश्न

Which of the following statements is the most appropriate for the private members? 

पर्याय

  • They are visible out of the class in which they are defined.

  • They can be used in the sub-classes.

  • They are only visible in the class in which they are declared.

  • None of the above. 

MCQ

उत्तर

They are only visible in the class in which they are declared.

Explanation:

Private is a keyword in programming languages that serves as an access modifier. When you declare an object as private, it can only be accessible within the class. We can, however, use the getter and setter methods to access private data. This keyword can be applied to attributes, methods, and constructors. 

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Class as the Basis of all Computation (Objects and Classes) - EXERCISES [पृष्ठ ३८२]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 6 Class as the Basis of all Computation (Objects and Classes)
EXERCISES | Q I. 4. | पृष्ठ ३८२
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×