You are on page 1of 2

Nepal Engineering College

Changunarayan, Bhaktapur

Unit Test I
Subject: OOP FM: 15
Time: 45 mins
Name: Roll:

Put a circle on the most appropriate answer. Each question carries 1 mark.

1. OOP is a:
a. Top-Down Approach
b. Bottom-Up Approach
c. Modular Approach
d. None
2. Which of the following is a feature of a class in OOP?
a. Data Storing
b. Data Retrieving
c. Data Hiding
d. All
3. Instance of a class is:
a. Class Definition
b. Class Declaration
c. Class Object
d. None
4. Friend function is:
a. A member function that can access the private data of a class.
b. A function that can access the private data of a class only.
c. An outside function that can access all the data of a class.
d. An outside function that can access only the private data of a class.
5. Inline function is:
a. A function that must be defined in a line of code.
b. A function that is not a member of any class.
c. A function that is very short.
d. A function whose call is replaced by its definition at the time of compilation.
6. A variable that can act as another existing variable is:
a. Pointer
b. User defined variable
c. Reference variable
d. None
7. Default argument is:
a. An argument that is passed as a coding fault.
b. An argument that is automatically taken if nothing is available.
c. An argument that is passed to all the functions automatically.
d. All
8. Constructor and Destructor differ in:
a. Memory allocation and de-allocation
b. Name
c. Overloading
d. All

2A
9. Constructor is called:
a. When an object is declared.
b. When a class is defined.
c. When an object is initialized.
d. When a program runs.
10. Memory leak is related to:
a. Class
b. Object
c. Constructor
d. Heap
11. Classes ‘Technology’ and ‘Computer’ can have:
a. IS-A relationship
b. HAS-A relationship
c. Both ‘a’ and ‘b’
d. None
12. Function overloading is _______ feature of OOP.
a. Polymorphism
b. Abstraction
c. Encapsulation
d. All
13. ‘this’ pointer points to:
a. Object declared inside the class.
b. Object passed as argument to the function.
c. Object that calls the function.
d. All
14. Function Overriding is:
a. A method by which a function disappears in a class.
b. A method by which a function in base class replaces the task of function in derived class.
c. A method by which a function in derived class replaces the task of function in base class.
d. A method by which a function rides over another function.
15. Inheritance helps in:
a. Software Reusability
b. Code Sharing
c. Rapid Prototyping
d. All

2A

You might also like