C++ Programming - OOPS Concepts

Exercise : OOPS Concepts - General Questions
  • OOPS Concepts - General Questions
51.
Which one of the following options is correct?
Friend function can access public data members of the class.
Friend function can access protected data members of the class.
Friend function can access private data members of the class.
All of the above.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

52.
Which of the following statements is correct in C++?
Classes cannot have data as protected members.
Structures can have functions as members.
Class members are public by default.
Structure members are private by default.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

53.
Which of the following is used to make an abstract class?
Declaring it abstract using static keyword.
Declaring it abstract using virtual keyword.
Making at least one member function as virtual function.
Making at least one member function as pure virtual function.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

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.

55.
What is correct about the static data member of a class?
A static member function can access only static data members of a class.
A static data member is shared among all the object of the class.
A static data member can be accessed directly from main().
Both A and B.
Answer: Option
Explanation:
No answer description is available. Let's discuss.