What is public, protected, private?
Answers were Sorted based on User's Feedback
Answer / khadeer.k
public:
public is an access specifier which can be used throughout
the program.
protected:
protected is an access specifier which can be used in the
specified class and its derived class...
private:
private is an access speifier which can be used whithin the
class in which it is declared.
| Is This Answer Correct ? | 20 Yes | 2 No |
Answer / yughandhar
public:
public is an access specifier which can be used throughout
the program.
protected:
protected is an access specifier which can be used in the
specified class and its derived class...
private:
private is an access speifier which can be used whithin the
class in which it is declared.
These three access specifiers are used for providing the
security
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / prashanth
public,protected,private are access modifiers where public
is used for acess the methods and variables to unlimited
extent.
private:is used to access the variables upto the enclosing
region
protected:and it is limited to class itself or classes that
are derived
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / yughandhar
they are acceses specifieres.
these are used for security purpose
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / priya
public:public is a access specifier and it is used to access
class member through out the program .
private:private is a access specifier by default our variables are private when we didn't specify any data type for our variable.
protected:protected is a access specifier and its a immediate to derived class.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / reena ashok mohite
Public, Protected And Private these Are the Access Specifier Which We Use In Within The Class,
We Can Use Protected Access specifier In The Class And Its Derived Class,
we Can Use Public Access Specifier throught out the class,
(Anywhere In The Class)
And Private Specifier Can Be Accessable Within The Class Where It Is Declared........
This Is Useful To Data Hiding Purpose
Thanks........
| Is This Answer Correct ? | 0 Yes | 0 No |
Write A Program using Single and Multiple Inheritance.
Can abstract class have normal methods?
What are two types of polymorphism?
What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 2) 17 3) 16.5
what are abstract classes and how they impliment , with example
Program to print 0 to 9 in cross order
What are the 4 main oop principles?
What is a class in oop?
What is the example of polymorphism?
1. Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)
What are the four main oops concepts?
Explain polymorphism? What r the types of polymorphism? pls give examples?