(S2-SUMMATIVE) Summative Assessment Object-Oriented Programming

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Which of the following is a type of polymorphism in Java?

  
Execution time polymorphism
 

  
Compile time polymorphism
 

  
Multilevel polymorphism
 

  
Multiple polymorphism
 
 
IncorrectQuestion 2
0 / 1 pts
Encapsulation means "open to all" and indicates that the internal workings of an object
are entirely visible to the outside world.

  
True
 

  
Sometimes
 

  
False
 
 
IncorrectQuestion 3
0 / 1 pts
OOP is a technique of solving a problem and breaking it down into smaller parts and
solving each of the smaller problems.

  
true
 

  
false
 
 
Question 4
1 / 1 pts
object-oriented programming, it is to break down a programming task into objects that
expose behavior (methods) and data (members or attributes) using interfaces.

  
true
 

  
false
 
 
Question 5
1 / 1 pts
Which of following statement(s) can result in new object instance creation if executed
successfully.

  
String str = "VirtuQ" + " "+ Simplifying Education";

  
int [] arr = {1,2,3,4,5};
 

  
String str = new String();
 

  
All
 

  
String str = new String("VirtuQ");
 
Question 6
1 / 1 pts
Class Variables are variables stored in the class and are available to all objects of a
class or objects of other classes if access is permitted

  
true
 

  
false
 
 
Question 7
1 / 1 pts
_________– used to change or access the private data in an object.

  
Custom Methods
 

  
Standard Methods
 

  
Constructor Methods
 
 
Question 8
1 / 1 pts
Accessor (Getter) – a method that is used to access or retrieve data.

  
false
 

  
true
 
 
Question 9
1 / 1 pts
Constructor – a method that is automatically executed when an object is created. This
method is used to initialize the attributes.

  
false
 
  
true
 
 
IncorrectQuestion 10
0 / 1 pts
Construct – a method that is automatically executed when an object is created. This
method is used to initialize the attributes.

  
false
 

  
true
 
 
Question 11
1 / 1 pts
If data members are private, what can we do to access them from the class object?

  
Create protected member functions to access those data members
 

  
Private data members can never be accessed from outside the class
 

  
Create private member functions to access those data members
 

  
Create public member functions to access those data members
 
 
IncorrectQuestion 12
0 / 1 pts
Which of the following is not an advantage to using inheritance?

  
Enhancements to a base class will automatically be applied to derived classes.
 
  
Similar classes can be made to behave consistently.
 

  
Code that is shared between classes needs to be written only once.
 

  
One big superclass can be used instead of many little classes.
 
 
Question 13
1 / 1 pts
While using encapsulation, which among the following is possible?

  
Code modification can be additional overhead
 

  
Data member's type can't be changed, or whole code have to be changed

  
Member functions can be used to change the data type of data members
 

  
Data member's data type can be changed without changing any other code
 
Question 14
1 / 1 pts
Encapsulation is supported by ___________

  
Classes
 

  
None of the above
 

  
Methods
 
  
Objects
 
 
Question 15
1 / 1 pts
Encapsulation has Better control of class attributes and methods

  
true
 

  
false
 
 
IncorrectQuestion 16
0 / 1 pts
In hierarchical inheritance, all the classes involve some kind of inheritance.

  
True
 

  
False
 
 
Question 17
1 / 1 pts
Which access type data gets derived as private member in derived class?

  
Private
 

  
Protected and Private
 

  
Protected
 
  
Public
 
 
Question 18
1 / 1 pts
If single inheritance is used, program will contain ________________

  
Exactly 2 classes
 

  
At most 4 classes
 

  
At most 2 classes
 

  
At least 2 classes
 
 
Question 19
1 / 1 pts
How many classes can be inherited by a single class in java?

  
Only 1
 

  
Only 27
 

  
Only 255
 

  
Only 1024
 
 
Question 20
1 / 1 pts
Which language doesn't support single level inheritance?

  
C++
 

  
All languages support it
 

  
Kotlin
 

  
Java
 

You might also like