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

Answer Posted / alka choubey

public:class members are access from the outside the class.
private:class members are access only within the class.
protected:class members can access inside the same package.

Is This Answer Correct ?    29 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a Program to find the largest of 4 no using macros.

571


List the issue that the auto_ptr object handles?

595


What is a multimap c++?

667


How does c++ sort work?

549


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3342






Program to check whether a word is a sub-string or not of a string typed

1582


What is an operator function? Describe the function of an operator function?

600


Can we use clrscr in c++?

518


Why do we need runtime polymorphism in c++?

549


Write a program to find the Fibonacci series recursively.

593


How do you invoke a base member function from a derived class in which you’ve overridden that function?

569


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

1982


What are c++ tokens?

582


Do you know the problem with overriding functions?

563


What are the 4 types of library?

581