0% found this document useful (0 votes)
84 views4 pages

Oops - Pre CCAT

Uploaded by

Nikhil Sabale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views4 pages

Oops - Pre CCAT

Uploaded by

Nikhil Sabale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Shriram Mantri Vidyanidhi Info Tech Academy

OOPs Question Bank


1) Which of the following is an abstract data type?
a. double b. Class c. string d. int

2) What term is used to describe the internal representation of an object that is hidden from view outside the
object's definition?
a. Encapsulation b. Inheritance c. Expandable d. Polymorphism

3) 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 content.
a. Inheritance b. Encapsulation c. Abstraction d. Polymorphism

4) Which of the following is not a type of inheritance?


a. Multiple b. Hierarchical c. Distributive d. Multilevel

5) Which one of the following is the correct way to declare a pure virtual function?
a. virtual void Display(void){0}; b. void Display(void) = 0;
c. virtual void Display(void) = 0; d. virtual void Display = 0;

6) Which one of the following is correct about the statements given below?
1. All function calls are resolved at compile-time in Procedure Oriented Programming.
2. All function calls are resolved at compile-time in OOPS.
a. Both I and II are correct. b. Only I is correct.
c. Both I and II are incorrect. d. Only II is correct.

7) Which of the following concepts is used to implement late binding?


a. Static function b. Virtual function c. Const function d. Operator function

8) Which of the following correctly describes overloading of functions?


a. Transient polymorphism b. Pseudo polymorphism
c. Ad-hoc polymorphism d. Virtual polymorphism

9) In a student grading system, objects from different classes communicate with each other. These communications
are known as _____.
a. concealment b. messages c. inheritance d. polymorphism

10) Which of the following approach is adapted by Object-oriented Programming?


a. Top-down b. Left-right c. Right-left d. Bottom-up

11) How many types of polymorphisms are supported by C++?


a. 3 b. 1 c. 2 d. 4

12) Which of the following concepts means waiting until runtime to determine which function to call?
a. Dynamic loading b. Data hiding c. Dynamic casting d. Dynamic binding

13) What happens if the base and derived class contains definition of a function with same prototype?
a. Base class object will call base class function and derived class object will call derived class function.
b. Only base class function will get called irrespective of object.
c. Only derived class function will get called irrespective of object.
d. Compiler reports an error on compilation.

14) Which of the following concepts means wrapping up of data and functions together?
a. Inheritance b. Polymorphism c. Encapsulation d. Abstraction

15) Which of the following provides a reuse mechanism?


a. Abstraction b. Dynamic binding c. Inheritance d. Encapsulation
Shriram Mantri Vidyanidhi Info Tech Academy
OOPs Question Bank

16) Which of the following concepts provides facility of using object of one class inside another class?
a. Inheritance b. Composition c. Abstraction d. Encapsulation

17) Pure virtual functions


a. Cannot have public access specifier. b. Have to be redefined in the inherited class
c. None of the above. d. Are mandatory for a virtual class.

18) When an object has many forms, it has _____.


a. Polymorphism b. Scalability c. Inheritance d. Encapsulation

19) How many instances of an abstract class can be created?


a. 1 b. 13 c. 0 d. 5

20) Which of the following concepts means determining at runtime what method to invoke?
a. Dynamic loading b. Dynamic Typing c. Dynamic binding d. Data hiding

21) Which of the following is correct about function overloading?


a. The order of argument is different.
b. The types of arguments are different.
c. The types of arguments are different and The order of argument is different are correct
d. The number of argument is same.

22) Which of the following is used to make an abstract class?


a. Declaring it abstract using static keyword.
b. Making at least one member function as pure virtual function.
c. Declaring it abstract using virtual keyword.
d. Making at least one member function as virtual function.

23) Which inheritance type is used in the class given below? class A : public X, public Y {}
a. Multiple inheritance b. Hybrid inheritance
c. Multilevel inheritance d. Hybrid inheritance

24) Which of the following statement is correct?


a. Object is an instance of data type. b. Class is an instance of data type.
c. Class is an instance of object. d. Object is an instance of a class.

25) Which of the following is correct about class and structure?


a. class data members are private by default while that of structure are public by default.
b. class can have member functions while structure cannot.
c. class data members are public by default while that of structure are private.
d. Pointer to structure or classes cannot be declared.

26) Overloading is otherwise called as


a) virtual polymorphism b) ad-hoc polymorphism
c) transient polymorphism d) pseudo polymorphism.

27) What is the output?


#include<iostream.h>
class myclass
{
public:

static int counter;


Shriram Mantri Vidyanidhi Info Tech Academy
OOPs Question Bank
};
void main()
{
cout<<myclass::counter;
}
a) output 0 b) compilation error c) Linking error d) output garbage value

28) The default access scope for a method in a C++ class is


a) Private b) Public
c) Protected d) Default

29) Where does memory get allocated for a static data members of a class
a) Code/text b) Stack
c) Heap d) Data

30) class Foo


{
int i;
};
In the above sample, what is the member access specifier of the member data "i"?
a) default b) virtual c) protected d) private e) public

31) What is the output?


#include<iostream.h>
class myclass
{
public:
void myclass()
{
cout<<endl<<"in myclass def\n";
}
myclass(int k)
{
cout<<endl<<"in param const\n";
}
};
void main()
{
myclass m1, m2(30);
}
a) output “ in param const “ b) output “in myclass def in param const”
c) compilation error d) runtime error

32) A _________ is a special member function used to initialize the data members of a class.

33) The default access for members of a class is _________.

34) Member functions of a class are normally made ________ and data members of a class are normally
made ________.

35) Which of the following statement is correct?


Shriram Mantri Vidyanidhi Info Tech Academy
OOPs Question Bank
a) A constructor is called at the time of declaration of an object.
b) A constructor is called at the time of use of an object.
c) A constructor is called at the time of declaration of a class.
d) A constructor is called at the time of use of a class.

36) Which one of the following options is correct?


a) Friend function can access public data members of the class.
b) Friend function can access protected data members of the class
c) friend function can access private data members of the class
d) All of the above

37) A member function can always access the data


a) in the object of which it is a member b) in the class of which it is a member
c) in any object of the class of which it is a member d) in the public part of its class

38) Which among the following type of pointer is used to represent an object that invokes a member
function
a) void pointer b) null pointer c) this pointer d) base pointer

You might also like