Home » » OOPS QUESTIONS FOR AMCAT #AMCAT #Oops

OOPS QUESTIONS FOR AMCAT #AMCAT #Oops

OOPS QUESTIONS FOR AMCAT

Q. Which of the following is not the member of class?
A. Static function
B. Friend function
C. Const function
D. Virtual function
Ans-B


Q. Which of the following concepts means wrapping up of data and functions together?
A. Abstraction B. Encapsulation
C. Inheritance D. Polymorphism
Ans-B


Q. Which of the following is a mechanism of static polymorphism?
A. Operator overloading
B. Function overloading
C. Templates
D. All of the above
Ans-D


Q. 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

Ans-C


Q. Which of the following is not a type of inheritance?
A. Multiple
 B. Multilevel
C. Distributive
D. Hierarchical

Ans-C


Q. Which of the following keyword is used to overload an operator?
A. overload
B. operator
C. friend
D. override

Ans-B

Q. Which of the following provides a reuse mechanism?
A. Abstraction
B. Inheritance
C. Dynamic binding
D. Encapsulation

Ans-B


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

Ans-Private


Q. Which of the following type of data member can be shared by all instances of its class?
A. Public
B. Inherited
C. Static
D. Friend

Ans-static


Q. What makes a class abstract?
A. By making all member functions constant.
B. By making at least one member function as pure virtual function.
C. By declaring it abstract using the static keyword.
D. By declaring it abstract using the virtual keyword.

Ans-B


Q. Which of the following can be overloaded?
A. Object
B. Functions
C. Operators
D. Both B and C

Ans- D


Q. Which type of class allows only one object of it to be created?
A. Virtual class
B. Abstract class
C. Singleton class
D. Friend class

Ans-Singleton class


Q. Which of the following is not a type of constructor?
A. Friend Constructor
B. Copy Constructor
C. Default Constructor
D. Parameterized Constructor
Ans-A
 

Q. correct ways to access a class data member using this pointer?

Ans-Multiple

Q. How many constructor is it possible to have for a class?

Ans-Multiple

Q. How many instances of abstract class is it possible to create?

Ans-Zero
 

Q. Which of the following cannot be friend?
A. Function
B. Class
C. Object
D. Operator function

Ans-Object

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

Ans-D

 
Q. By default, accessibility of the member of class is?
A. Public
B. Private
C. Protected
D. None of these

Ans-B
 
Q. How many types of polymorphism exists in C++?

Ans-4
 
Q. A constructor is called whenever a;
A. Object is declared
B. Object is created
C. A class is declared
D. A class is used
E. An object is created from another object

Ans-A
 

Q. Select valid statements regarding C structures and C++ classes
A. Structures do not support data hiding but classes do
B. Structures cannot have member functions while classes can
C. Data members by default, are private in structures and protected in case of classes
D. There are no access specifiers in case of structures but classes do

Ans-A, B, D

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

Ans-D

 
Q. Which of the following cannot be inherited?
A. Friend function
B. Static function
C. Destructor

Ans-B
 
Q. Which of the following correctly describes overloading of functions?
A. Virtual polymorphism
B. Transient polymorphism
C. Ad-hoc polymorphism
D. Pseudo polymorphism

Ans-C

 
Q. Which of the following operator is overloaded for object cout?
A. >>
B. <<
C. +
D. =


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

Ans-D


The process of building new classes from existing one is called ______.
(A) Polymorphism 
(B) Structure
(C) Inheritance 
(D) Cascading

Ans-inheritance


If a class C is derived from class B, which is derived from class A, all through publicinheritance, then a class C member function can access
(A) protected and public data only in C and B.
(B) protected and public data only in C.
(C) private data in A and B.
(D) protected data in A and B.

Ans-D


Usually a pure virtual function
(A) has complete function body.
(B) will never be called.
(C) will be called only to delete an object.
(D) is defined only in derived class.

Ans-D


Overloading the function operator
(A) requires a class with an overloaded operator.
(B) requires a class with an overloaded [ ] operator.
(C) allows you to create objects that act syntactically like functions.
(D) usually make use of a constructor that takes arguments.

Ans-A


Mechanism of deriving a class from another derived class is known as____
(A) Polymorphism 
(B) Single Inheritance
(C) Multilevel Inheritance 
(D) Message Passing

Ans-C


RunTime Polymorphism is achieved by ______
(A) friend function 
(B) virtual function
(C) operator overloading 
(D) function overloading

Ans-B


A function call mechanism that passes arguments to a function by passing a copy of the values
of the arguments is __________
(A) call by name
(B) call by value
(C) call by reference
 (D) call by value result

Ans-B


A property which is not true for classes is that they
(A) are removed from memory when not in use.
(B) permit data to be hidden from other classes.
(C) bring together all aspects of an entity in one place.
(D) Can closely model objects in the real world

Ans-C


The process of building new classes from existing one is called
(A) Structure.
 (B) Inheritance.
(C) Polymorphism. 
(D) Template.

Ans-B


A friend function to a class, C cannot access
(A) private data members and member functions.
(B) public data members and member functions.
(C) protected data members and member functions.
(D) the data members of the derived class of C.

Ans-D


A struct is the same as a class except that
(A) there are no member functions.
(B) all members are public.
(C) cannot be used in inheritance hierarchy.
(D) it does have a this pointer.

Ans-C


Pure virtual functions
(A) have to be redefined in the inherited class.
(B) cannot have public access specification.
(C) are mandatory for a virtual class.
(D) None of the above.

Ans-A


Use of virtual functions implies
(A) overloading. 
(B) overriding.
(C) static binding.
 (D) dynamic binding.

Ans-D


In multiple inheritance
(A) the base classes must have only default constructors
(B) cannot have virtual functions
(C) can include virtual classes
(D) None of the above.

Ans-C


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

Ans-C