What are the differences between public, private, and
protected access?
Answers were Sorted based on User's Feedback
Answer / koushik k reddy
Private:
It cannot be accessed by object and cannot be inherited, will be used only by the member functions of the class
Protected:
It cannot be accessed by the object and used by the member functions of the class can be inherited to first level of inheritance
Public:
It can be accessed by the objects and can be inherited to any level
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
How much is c++ certification?
Is there anything you can do in C++ that you cannot do in C?
what is data Abstraction
Explain dangling pointer.
Can java be faster than c++?
Why is c++ called oops?
What is dynamic and static typing?
a class that maintains a pointer to an object that is programatically accessible through the public interface is known as?
What is an incomplete type?
What are pointers used for c++?
What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor
How can a '::' operator be used as unary operator?