AMCAT Previous Years Questions on OOPS : Polymorphism Abstraction Encapsulation

Sub- Topics
Expected Questions
Basic Programming
10 – 12 Questions
Data Structures
6 – 8 Questions
4 – 6 Questions
4 – 5 Questions

Question 1
A virtual function that has no definition within the base class is called?
A. Pure virtual function
B. Pure static function
C. Pure Const function
D. Virtual Function

Correct Answer: A 

Question 2
Syntax for Pure Virtual Function is?
A. virtual void show()==0
B. void virtual show()==0
C. virtual void show()=0
D. void virtual show()=0

Correct Answer: A
Question 3
C++ supports run time polymorphism with the help of virtual functions, which is called …………….. binding?
A. dynamic
B. run time
C. early binding
D. static

Correct Answer: A
Question 4
Find the wrong statement/s about Abstract Class?
A. We can’t create its objects.
B. We can’t create pointers to an abstract class.
C. It contains at least one pure virtual function.
D. We can create references to an abstract class.

Correct Answer:B
We can’t create pointers to an abstract class.

Question 5
Which of the followings are true about Virtual functions?
A. They must be non-static member function of the class
B. They cannot be friends
C. Constructor Functions cannot be virtual
D. All of these

Correct Answer:D
Question 6
Which of the following correctly describes overloading of functions?
A. Virtual polymorphism
B. Ad-hoc polymorphism
C. Transient polymorphism
D. Pseudo polymorphism

Correct Answer:B
Question 7
Which of the following operator is overloaded for object cout?
A. +
B. >>
C. <<
D. =
E. ()

Correct Answer:B
Question 8
Which of the following operators cannot be overloaded? A B C
A. *
B. ->
C. []
D. ?:

Correct Answer: A
Question 9
The operator << when overloaded in a class
A. must be a member function
B. must be a non member function
C. can be both (A) & (B) above
D. cannot be overloaded

Correct Answer: C

Question 1
Which of the following concepts of OOPS means exposing only necessary information to client?
A. Abstraction
B.  Encapsulation
C. Data hiding
D. Data binding

Correct Answer:D
Question 2
Which of the following cannot be inherited?
A. Friend
B. Static
C. Destructor

Correct Answer:B
Question 3
Which of the following are available only in the class hierarchy chain?
A. Public data members
B. Private data members
C. Protected data members
D. Member functions

Correct Answer:C
Question 4
Tarun wants to write code for his computer class homework but he had misheard the teacher and only can recollect remembering this 4 words. Which of the following is what he couldn’t have had heard?
A. Distributive
B. Multilevel
C. Multiple
D. Hierarchical

Correct Answer: A
Question 5
Tarun works all night long writing code and writing more and more classes for each object he now thinks that he can write a superclass which defines some hierarchical feature for other classes, what can he use?
A. Cascading
B. Hierachical Super Positioning
C. Inheritance
D. Polymorphism

Correct Answer:C
Question 6
Palak enters a coding competition she wants to write code to pass down values from one class to another?
A. Inherits
B. extends
C. Construct
D. all of the mentioned

Correct Answer: B

Question 7
How will a class protect the code inside it?

A. Using Access specifiers. 
B. Abstraction
C. Use of Inheritance
D. All of the mentioned

Correct Answer: A
Each method or variable in a class may be marked ‘public’ or ‘private’. They are called Access Specifiers. 

Question 8
Which type of inheritance needs a virtual function:
A. Multi level inheritance
B. Multiple inheritance
C. Hybrid inheritance
D. All the above

Correct Answer: D

Question 1
In c++ how are protected members of a base class accessed in derived class when inherited privately
A. Privately
B. Publicly
C. Protectedly
D. Not Inherited

Correct Answer: A
Question 2
Which of the following statements is correct when a class is inherited publicly?
A. Public members of the base class become protected members of derived class.
B. Public members of the base class become private members of derived class.
C. Private members of the base class become protected members of derived class.
D. Public members of the base class become public members of derived class.

Correct Answer:D
Question 3
Which of the following access specifies is used in a class definition by default?
A. Protected
B. Public
C. Private
D. Friend

Correct Answer: C

Question 4
Which of the following can access private data members or member functions of a class?
A. Any function in the program.
B. All global functions in the program.
C. Any member function of that class.
D. Only public member functions of that class.

Correct Answer:C
Question 5
Which of the following statements about virtual base classes is correct?
A. It is used to provide multiple inheritance.
B. It is used to avoid multiple copies of base class in derived class.
C. It is used to allow multiple copies of base class in a derived class.
D. It allows private members of the base class to be inherited in the derived class.

Correct Answer: B 

Question 6
State whether the following statements about inheritance are True or False. i) A public member of a class can be accessed by its own objects using the dot operator. ii) While inheriting, the private members of the base class will never become the members of its derived class.
A. True, False
B. False, True
C. True, True
D. False, False

Correct Answer:C
Question 7
Encapsulation is?

A. Binds together code and data
B. Using single interface for general class of actions.
C. Reduce Complexity
D. All above

Correct Answer: A
Question 8
Which of the following concepts means wrapping up of data and functions together?
A. Abstraction
B. Encapsulation
C. Inheritance
D. None

Correct Answer:B