Google News
logo
CPP - Quiz(MCQ)
The C++ language is ______ object-oriented language.
A)
Pure Object oriented
B)
Semi Object-oriented or Partial Object-oriented
C)
Not Object oriented
D)
None of the above

Correct Answer :   Semi Object-oriented or Partial Object-oriented


Explanation :

The common thing about the Pure Object-oriented language it provides three basic features like Inheritance, Encapsulation, and Polymorphism. Each programming language that supports these entire three features is known as the Pure-Object oriented language. Whereas if a programming language support all these three features but not support completely are known as the Partial-Object oriented languages or the Semi Object-oriented languages
 
The main reasons why the C++ programming language is Known as Semi-Object oriented language are as follows:
 
i) Availability of the Friend function : 
A friend class is allowed to access private and protected members of another class, within which it is declared a friend. It may be very useful for some time, but still, it violates the rule of the Object-Oriented features.

ii) Concept of the Global variable :
As we all know that we can declare a global variable in C++ language that can be easily accessible from anywhere within the program. So again, C++ does not provide complete privacy because no one is restricted to access and manipulate that data/information. Hence it offers partial Encapsulation, unlike Java Language, in which a user only allows to declare a variable within the class and can provide access specifier to it.

iii) The main function is Out-side the class :
C++ is an object-oriented language, but still, object-oriented is not fundamentally related (or implicit) to the language. So a user can easily write a valid, well-defined C++ code even without using any object once.

Advertisement