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 |
give me some class & objects examples?
Define macro.
How does throwing and catching exceptions differ from using setjmp and longjmp?
Can you overload the operator+ for short integers?
Is set c++?
Describe private, protected and public?
implement stack using stack.h headerfile functions
1 Answers Exilant, GMG, Subex, University,
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
What is a container class? What are the types of container classes?
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
What is type of 'this' pointer? Explain when it is get created?
How would you implement a substr() function that extracts a sub string from a given string?