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

Answer Posted / golledla prathap reddy

public data can access anybody in the program.
private data can access olny members of that class.
protected also same like private but the difference is it
can access by derive class also.
we can see the use of protected data in inheritance.

Is This Answer Correct ?    64 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a c++ map?

664


Please explain the reference variable in c++?

618


What is the iunknown interface?

681


What is a driver program?

633


Can you Mention some Application of C/C++?

628






In what situations do you have to use initialization list rather than assignment in constructors?

637


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

5899


What is searching? Explain linear and binary search.

587


Explain the concept of memory leak?

631


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

683


What is the purpose of templates in c++?

566


Describe the setting up of my member functions to avoid overriding by the derived class?

613


What is data abstraction? How is it different from data encapsulation?

538


Does c++ vector allocate memory?

534


What are the important differences between c++ and java?

606