Advertisements
Advertisements
प्रश्न
Explain any two types of access specifiers.
लघु उत्तर
उत्तर
- Public: Accessible from all classrooms.
- Private: Only available within the class in which it is declared.
- Protected: Classes and their inherited subclasses can access them.
- When no access specifier is given, the default access is limited to classes inside the same package.
shaalaa.com
Notes
Students should refer to the answer according to their questions.
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Class as the Basis of all Computation (Objects and Classes) - EXERCISES [पृष्ठ ३८४]