1. In an object model, there are major and minor elements. Which one of the following is true? |
Abstraction, Encapsulation and Persistence are the major elements. |
Hierarchy, Concurrency and Typing are the major elements. |
Abstraction, Encapsulation and Hierarchy are the major elements. |
Typing is the major element.
|
2. Which of the following is not a part of OOP? |
Multitasking |
Information hiding |
Polymorphism |
Type checking
|
3. Which one of the following is the first fully Object-oriented language? |
Simula. |
Java. |
C++. |
Javascript.
|
4. Programming without inheritance |
is programming with abstract data types |
is not object oriented |
can be object oriented |
none of the above
|
5. Which one of the following terms must relate to "polymorphism" |
Static allocation. |
Static typing. |
Dynamic binding. |
Dynamic allocation.
|
6. Providing access to an object only through its member functions, while keeping the details private is called . |
information hiding. |
encapsulation. |
modularity |
inheritance
|
7. The concept of derived classes is involved in |
inheritance. |
encapsulation. |
data hiding. |
abstract data types.
|
8. Which of the following statements is true in C++? |
An object can be a class. |
A class can be an object. |
A class must have at least one member function. |
If a constructor for a class is not specified, a default constructor is used.
|
9. A member function |
is always public |
is always private |
can be public or private |
cannot be defined.
|
10. Inheritance is a way to |
organize data. |
pass arguments to objects of classes |
add features to existing classes without rewriting them. |
improve data-hiding and encapsulation.
|
11. What is the purpose of the main method? |
To build a user interface. |
To hold the APIs of the application. |
To create buttons and scrollbars. |
To act as the entry point for the program.
|
12. What is the advantage of using import statements? |
To avoid having to declare variables. |
To refer to a class without using prefixes. |
To avoid calling methods. |
To import the images you want to use.
|
13. A constructor is used to... |
Free memory. |
Initialize a newly created object. |
Import packages. |
Create a JVM for applets.
|
14. Because friend functions are inherited, deriving a class from a base class with friends can violate the encapsulation of the derived class. |
True |
False |
|
|
15. When deriving from a private base class, the public, protected and private members of the base class become private members of the derived class. |
True |
False |
|
|
16. A base-class initializer must always be provided in the derived-class constructor to call the base-class constructor. |
True |
False |
|
|
17. After we implement inheritance in our system, we must recompile all our .cpp files before building an executable file. |
True |
False |
|
|
18. Placing the elevatorRef data member in the protected section of the base-class declaration allows the derived classes to access that data member. |
True |
False |
|
|
19. Polymorphism makes systems less extensib |
True |
False |
|
|
20. Dynamic method binding is a Java feature that exhibits polymorphism. |
True |
False |
|
|
21. Abstract class objects never have to be instantiated. |
True |
False |
|
|
22. DNS is: |
A system that translates domain names to IP addresses |
A link layer protocol |
Distant Network System |
A link layer protocol
|