difference between default access specifier and private access specifier
Answers
Answered by
0
Any member of a class mentioned without any access specifier then it is considered that as Default. The Default will act as public within the same package and acts as private outside
Answered by
1
Answer:
A public member is accessible from anywhere outside the class but within a program. You can set and get the value of public variables without any member. A private member variable or function cannot be accessed, or even viewed from outside the class. Only the class and friend functions can access private members.Any member of a class mentioned without any access specifier then it is considered that as Default. The Default will act as public within the same package and acts as private outside the package.
Similar questions