private public difference – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-ICSE2018-01D #JAVA#4030    siteicon   siteicon  

Problem Statement - private public difference

How are private members of a class different from public members?

Solution

TC++ #4030

Private Members:
– Can be accessed within the scope of a class itself.
– Requires a private modifier.

Public Members:
– Can be accessed within the class scope as well as anywhere outside the class also (other packages, subclass or the world)
– Requires a public modifier.

Notes


Share

sunmitra| Created: 24-Mar-2018 | Updated: 12-Apr-2019|ICSE2018









Back