Exercise

1.The OOPs concept in C++, exposing only necessary information to users or clients is known as

A. Data hiding
B. Encapsulation
C. Hiding complexity
D. Abstraction

View Answer


2.Which is private member functions access scope?

A. Member functions which can used outside the class
B. Member functions which are accessible in derived class
C. Member functions which can only be used within the class
D. Member functions which can’t be accessed inside the class

View Answer


3.C++ was originally developed by

A. Sir Richard Hadlee
B. Clocksin and Mellish
C. Donald E. Knuth
D. Bjame Stroustrup

View Answer


4. Which of the following provides a reuse mechanism?

A. Abstraction
B. Inheritance
C. Dynamic binding
D. Encapsulation

View Answer


5.In a class, encapsulating an object of another class is called

A. Encapsulation
B. Inheritance
C. Composition
D. None of the above

View Answer


6.A private function of a derived class can be accessed by the parent class.

A. True
B. False

View Answer


7.Reusability is a desirable feature of a language as it

A. Decreases the testing time
B. Reduces the compilation time
C. Lowers the maintenance cost
D. Both A and C

View Answer


8.Which of the following access specifier is used as a default in a class definition?

A. Private
B. Public
C. Friend
D. Protected

View Answer


9.Not using virtual destructor feature in a C++ object oriented programing can cause

A. An Issue in creating object of the class
B. Memory leak
C.An issue in calling base class destructor
D.None of the above

View Answer


10. If private member functions are to be declared in C++ then __________

A. private(private member list)
B. private
C. private:
D. private :-

View Answer


11.The order in which operands are evaluated in an expression is predictable if the operator is

A. +
B. %
C. *
D. &&

View Answer


12.Which of the following is a mechanism of static polymorphism?

A. Templates
B. Function overloading
C. Operator overloading
D. All of the above

View Answer


13.IS A relationship in C++ is

A. Inheritance
B. Encapsulation
C. Composition
D. None of the above

View Answer


14.Can main() function be made private?

A. Yes, always
B. Yes, if program doesn’t contain any classes
C. No, because main function is user defined
D. No, never

View Answer


15. At what point of time a variable comes into existence in memory is determined by its

A. Data type
B. Storage class
C. Scope
D. All of the above

View Answer


16.Which of the following concepts is used to implement late binding?

A. Static function
B. Virtual function
C. Const function
D. Operator function

View Answer


17.For Cat and Animal class, correct way of inheritance is

A. Class Cat: public Animal
B. Class Animal: public Cat
C. Both are correct way
D. None is correct way

View Answer


18.Which of the following operators cannot be overloaded ?

A.  .
B.  ?:
C.  >>
D.  Both A and B

View Answer


19. Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object.

A. Inheritance
B. Polymorphism
C. Abstraction
D. Encapsulation

View Answer


20.Which of the following correctly describes overloading of functions?

A. Virtual polymorphism
B. Transient polymorphism
C. Ad-hoc polymorphism
D. Pseudo polymorphism

View Answer


21.How many loops are there in C++ 98?

A. 2
B. 3
C. 4
D. 5

View Answer



Discussion

* You must be logged in to add comment.