What are the access specifiers avaible in c++?
Answers were Sorted based on User's Feedback
Answer / kanan
public,
private ,
protected ,
internal and
protected internal
public :
public is the most common access specifier in C# . It can be
access from anywhere, that means there is no restriction on
accessibility. The scope of the accessibility is inside
class as well as outside. The type or member can be accessed
by any other code in the same assembly or another assembly
that references it.
private :
The scope of the accessibility is limited only inside the
classes or struct in which they are declared. The private
members cannot be accessed outside the class and it is the
least permissive access level.
protected :
The scope of accessibility is limited within the class or
struct and the class derived (Inherited )from this class.
internal :
The internal access modifiers can access within the program
that contain its declarations and also access within the
same assembly level but not from another assembly.
protected internal :
Protected internal is the same access levels of both
protected and internal. It can access anywhere in the same
assembly and in the same class also the classes inherited
from the same class .
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / xxx
The last answer is wrong. internal and Protected Internal
not there in C++. Answer is relevant to C# not C++.
Is This Answer Correct ? | 4 Yes | 1 No |
Why do we use encapsulation in oops?
In OverLoading concept,Why they are not consider return value and why they are consider only parameters in method? For ex: public int Add(int a,int b){...} public String Add(int a,int b){...}
How to calculate the age from the date of birth by using the program?
Difference ways of Polymorphism?
What is oops in programming?
Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku
what is new operator in c++
WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.
What are the two different types of polymorphism?
How to Increment the value of the empid E001 for each and every employee by using the programe?
tell about copy constructor
What is a mixin class?