Advertisements
Advertisements
प्रश्न
Differentiate between public and private modifiers for the members of a class.
फरक स्पष्ट करा
उत्तर
- Private modifier: A class member declared to be private has its access limited to the class block only. By no means, a private member can be applied outside the class block.
- Public modifier: A class member that is declared to be public can be accessed inside as well as outside the class block. By default, a class member is declared to be public.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?