Object Oriented System Design Multiple Choice Questions & Answers (MCQs) “Object Oriented Programming Principles”.

1. Which of the following is the functionality of ‘Data Abstraction’?

a) Reduce Complexity
b) Binds together code and data
c) Parallelism
d) None of the mentioned

Answer: a
Explanation: An essential element of Object Oriented Programming is ‘Data Abstraction’ which means hiding things. Complexity is managed through abstraction.

2. Which of the following mechanisms is/are provided by Object Oriented Language to implement Object Oriented Model?
a) Encapsulation
b) Inheritance
c) Polymorphism
d) All of the mentioned

Answer: d
Explanation: None.

3. Which of the these is the functionality of ‘Encapsulation’?
a) Binds together code and data
b) Using single interface for general class of actions.
c) Reduce Complexity
d) All of the mentioned

Answer: a
Explanation: ‘Encapsulation’ acts as protective wrapper that prevents code and data from being accessed by other code defined outside the wrapper.

4. What is ‘Basis of Encapsulation’?
a) object
b) class
c) method
d) all of the mentioned

Answer: d
Explanation: Encapsulation is the mechanism that binds together code and data it manipulates, and keeps both safe from outside interface and misuse. Class, which contains data members and methods is used to implement Encapsulation.

5. How will a class protect the code inside it?
a) Using Access specifiers
b) Abstraction
c) Use of Inheritance
d) All of the mentioned

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

6. What is the output of this program?

  1.   Test 
  2.       a
  3.        b
  4.        c
  5.  
  6.   AcessTest 
  7.         main args
  8.      
  9.          Test ob   Test
  10.          ob.  
  11.          ob.  
  12.          ob.  
  13.          ..  ob.    ob.    ob.
  14.      

a) Compilation error
b) Run time error
c) Output : a, b and c 10 20 30
d) None of the mentioned

Answer: a
Explanation: Private members of a class cannot be accessed directly. In the above program, the variable c is a private member of class ‘Test’ and can only be accessed through its methods.

7. Which of the following is a mechanism by which object acquires the properties of another object?
a) Encapsulation
b) Abstraction
c) Inheritance
d) Polymorphism

Answer: c
Explanation: ‘Inheritance’ is the mechanism provided by Object Oriented Language, which helps an object to acquire the properties of another object usually child object from parent object.

8. Which of the following supports the concept of hierarchical classification?
a) Polymorphism
b) Encapsulation
c) Abstraction
d) Inheritance

Answer: d
Explanation: Use of Hierarchical classification avoids defining the properities of object explicitly at each level which have acquired their properties from higher levels.

9. Which Keyword from the following is used to inherit properties from one class into another?
a) extends
b) subclasses
c) native
d) all of the mentioned

Answer: a
Explanation: None.

10. Which of the following concept is often expressed by the phrase, ‘One interface, multiple methods’?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Encapsulation

Answer: b
Explanation: None.
To practice all areas of Objection Oriented System Design, .

This set of Object Oriented System Design Multiple Choice Questions & Answers (MCQs) focuses on “Data Types”.

1. Which of the following data types are available in Java?
a) Primitive Datatypes
b) Reference Datatypes
c) Both
d) None of the mentioned

Answer: b
Explanation: Primitive Datatypes are defined by Java. Reference Datatypes are user defined, created using defined constructors of class.

2. How many Primitive data types are there in Java?
a) 4
b) 2
c) 8
d) 7

Answer: c
Explanation: Java defines eight simple types of data which are put in four groups. They are integers, floating-point numbers, boolean, characters.

3. Which of the following data types comes under ‘Integer’ data type?
a) short
b) long
c) int
d) all of the mentioned

Answer: d
Explanation: None.

4. Which of the following data types comes under ‘Floating’ data type?
a) float
b) byte
c) double
d) a and c

Answer: d
Explanation: Only ‘float’ and ‘double’ belong to floating-point numbers. ‘byte’ comes under ‘Integer’ data type.

5. Which of the following is not a primitive data type?
a) enum
b) short
c) byte
d) char

Answer: a
Explanation: An ‘enum’ data type is special data type that enables a variable to store set of predefined constants.

6. Which of following cannot be stored in character data type?
a) Special symbols
b) String
c) Letter
d) Digit

Answer: b
Explanation: String is a collection of characters and is stored in a variable of string data type.

7. Which of the following is smallest integer data type?
a) short
b) long
c) byte
d) double

Answer: c
Explanation: ‘byte’ is signed 8-bit smallest integer data type that has range from -128 to 127.

8. Which of the following keyword is used to declare Byte data type?
a) Bytes
b) Byte
c) bytes
d) byte

Answer: d
Explanation: None.

9. Which of the following data type is used to create a number for counting or indexing arrays?
a) byte
b) long
c) int
d) float

Answer: c
Explanation: None.
Answer: b
Explanation: ‘double’ is the longest data type with 64-bit defined by Java to store floating-point values.
To practice all areas of Objection Oriented System Design, .