What do you mean by public, private, protected and friendly?
Answers were Sorted based on User's Feedback
Answer / kumar vishal
this is access specifier which is used with member data and
member function inside a class.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / achal ubbott
public means access to the object of the class, created in
outside world.
private and protected are almost the same, except the
difference that protected members are inheritable and thus
can be used by derived class. These can be accessed only by
the public function members of the class.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / diya verma
Public : it is access modifier and also known as visibility mode.It is used to declare public members in a class.It is also used in inherit the derived class which shows public member of base class with the help of object of derived class in global scope.The public member can be accessed outside the class.
Private:It is access modifier and also known as visibility mode.It is used to accessed inside the class I.e the member of class is private.
1. All the public member will be private member of child class.
2.All the protected member will be private member of child class.
3.Private member can't be inherit.
Protected:It is access modifier and also known as visibility mode.
1.All public members will be protected member of child class.
2.All the protected member will be protected member of child class.
3.Private member can't be inherit.
| Is This Answer Correct ? | 0 Yes | 0 No |
design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }
What is inheritance write a program to show use of inheritance?
What is difference between new and malloc?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
how many types of notations are in java
1 Answers National University of Modern Languages (NUML),
What is the difference between pass by reference and pass by value?
What is object and example?
What is the difference between procedural programming and oops?
What is the point of oop?
What is coupling in oop?
to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123
explain the concepts of oops?