This set of Java Multiple Choice Questions & Answers (MCQs) on “Concepts of OOPs”.
But, i have been taking it for about three months. These drugs should not be Hinganghāt used during pregnancy and breastfeeding. The government also has been granted the right to issue a special license to grow medical marijuana in bolivia, the program has received a renewed commitment from the government to allow it to grow in the country.
1. Which of the following is not OOPS concept in Java? Answer: d 2. Which of the following is a type of polymorphism in Java? Answer: a 3. When does method overloading is determined? Answer: b 4. When Overloading does not occur? Answer: d 5. Which concept of Java is a way of converting real world objects in terms of class? Answer: c 6. Which concept of Java is achieved by combining methods and attribute into a class? Answer: a 7. What is it called if an object has its own lifecycle and there is no owner? Answer: d 8. What is it called where child object gets killed if parent object is killed? Answer: b 9. What is it called where object has its own lifecycle and child object cannot belong to another parent object? Answer: a 10. Method overriding is combination of inheritance and polymorphism? Answer: a
a) Inheritance
b) Encapsulation
c) Polymorphism
d) Compilation
Clarification: There are 4 OOPS concepts in Java. Inheritance, Encapsulation, Polymorphism and Abstraction.
a) Compile time polymorphism
b) Execution time polymorphism
c) Multiple polymorphism
d) Multilevel polymorphism
Clarification: There are two types of polymorphism in Java. Compile time polymorphism (overloading) and runtime polymorphism (overriding).
a) At run time
b) At compile time
c) At coding time
d) At execution time
Clarification: Overloading is determined at compile time. Hence, it is also known as compile time polymorphism.
a) More than one method with same name but different method signature and different number or type of parameters
b) More than one method with same name, same signature but different number of signature
c) More than one method with same name, same signature, same number of parameters but different type
d) More than one method with same name, same number of parameters and type but different signature
Clarification: Overloading occurs when more than one method with same name but different constructor and also when same signature but different number of parameters and/or parameter type.
a) Polymorphism
b) Encapsulation
c) Abstraction
d) Inheritance
Clarification: Abstraction is the concept of defining real world objects in terms of classes or interfaces.
a) Encapsulation
b) Inheritance
c) Polymorphism
d) Abstraction
Clarification: Encapsulation is implemented by combining methods and attribute into a class. The class acts like a container of encapsulating properties.
a) Aggregation
b) Composition
c) Encapsulation
d) Association
Clarification: It is a relationship where all objects have their own lifecycle and there is no owner. This occurs where many to many relationships are available, instead of one to one or one to many.
a) Aggregation
b) Composition
c) Encapsulation
d) Association
Clarification: Composition occurs when child object gets killed if parent object gets killed. Aggregation is also known as strong Aggregation.
a) Aggregation
b) Composition
c) Encapsulation
d) Association
Clarification: Aggregation occurs when objects have their own life cycle and child object can associate with only one parent object.
a) True
b) false
Clarification: In order for method overriding, method with same signature in both superclass and subclass is required with same signature. That satisfies both concepts inheritance and polymorphism.