What are the differences between public, private, and
protected access?

Answer Posted / kalpana.y


Private is used for intialization of variables
eg:
int p,r;
public is used for function name
eg:
void display();
protected is used for void main()

eg:
void main()
class c;

Is This Answer Correct ?    24 Yes 86 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does scope resolution operator do?

590


which operator is used for performing an exponential operation a) > b) ^ c) none

602


When does a name clash occur in c++?

710


How come you find out if a linked-list is a cycle or not?

567


Incase of a function declaration, what is extern means?

513






Describe the advantages of operator overloading?

569


What c++ library is string in?

564


Is c++ a programming language?

590


What is c++ and its uses?

614


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1729


What is constructor c++?

661


What are dynamic type checking?

608


What are c++ storage classes?

614


What is a modifier in c++?

625


What is meant by iomanip in c++?

602