Computer Science, asked by saishaileshshetty, 9 months ago

Differentiate private and public members of a class​

Answers

Answered by fathimahijas97
3

Answer:

a public member is accessible from anywhere outside the class but within aprogram.you can set and get the value of public variables without any member. A private member variable or functio cannot be accessed or even viewed from outside the class.only the class and friend function can access private members

Answered by anjalibanode9457
3

Answer:

Hlo mate......

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.

Hope this will help you............

Mark my answer...

Similar questions