MCQs – C++ OOPs


Q) The OOPs concept in C++, exposing only necessary information to users or clients is known as
  1. Abstraction
  2. Encapsulation
  3. Data hiding
  4. Hiding complexity
View Answer
Answer: A

Q) Which of the following is an abstract data type?
  1. Class
  2. Int
  3. String
  4. Double
View Answer
Answer: A

Q) Hiding the complexity is known as
  1. Abstraction
  2. Encapsulation
  3. Data hiding
  4. Composition
View Answer
Q) For Cat and Animal class, correct way of inheritance is
  1. class Cat: public Animal
  2. class Animal: public Cat
  3. Both are correct way
  4. None is correct way
View Answer
Answer: A



7 thoughts on “MCQs – C++ OOPs”

        • Thanks for your question Nadeem. Yes hiding the complexity whatever the ways you hide is encapsulation and it is an implementation level concepts. Abstraction is a design level concept in which you ONLY decide what essential details to expose to user/clients and ENCAPSULATE the rest.

          As a side note you might be familiar: wrapping a class field withing a method is just an EXAMPLE of encapsulation.

          Hope this clears you. You can ask further questions and I’ll be happy to answer.
          -Rakesh

          Reply

Leave a Comment