What is public, protected, private?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it so that we can have virtual constructors but we cannot have virtual destructors?

3846


What is the difference between encapsulation and polymorphism?

598


can inline function declare in private part of class?

3660


Why do we use class in oops?

555


Describe these concepts: Polymorphism, Inheritance and Abstraction.

616






What is abstraction with example?

607


program for insertion ,deletion,sorting in double link list

2283


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

632


What is class and object in oops?

613


What are the components of marker interface?

602


What are main features of oop?

636


What is class and example?

569


can we make game by using c

3431


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1149


What are the two different types of polymorphism?

672