C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 54)
54.
Which of the following access specifier is used as a default in a class definition?
protected
public
private
friend
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
11 comments Page 1 of 2.

Rahul said:   6 years ago
Private is the right answer. The default access specifier in C++ language is private.

Haripriya said:   6 years ago
Yes, I think the option B is correct.

Srinidhi said:   7 years ago
Yes, it's public. I also agree.

Sushumna said:   8 years ago
I think it is option B. Because public is always a default one.

Sheikh Asrar Danish said:   9 years ago
Here the question is default class definition, and we all knows that public is by default assign to class at the time definition. So ANSWER must be option B.

Sudhanshu Shukla said:   10 years ago
Dear @Puja Shahi.

Class can never declare private in Java.

Bhushan said:   1 decade ago
One of the big five feature of OOPS languages is inheritance. Then if we declare the class as private then there is no use of inheritance.

Puja shahi said:   1 decade ago
Yes it is private by default both in C++ and Java.

Rajabhupal said:   1 decade ago
In C++ we declare any function before these functions use access specifiers those are public, private in this public is explicitly declare by the programmer but private declared as default.

Biren Mishra said:   1 decade ago
Dear @Ravi, In the question it is given as class Definition not class member. So default access specifier for a class definition is either public or Internal. So the answer should be public(option B).


Post your comments here:

Your comments will be displayed after verification.