Test Preparation on JAVA Test Prep. - Java Environment & OOPS Concepts
1.
Which of the following is not OOPS concept in Java?
Explanation: There are 4 OOPS concepts in Java. Inheritance, Encapsulation, Polymorphism and Abstraction.
2.
Which of the following is a type of polymorphism in Java?
Explanation: There are two types of polymorphism in Java. Compile time polymorphism (overloading) and runtime polymorphism (overriding).
3.
When does method overloading is determined?
Explanation: Overloading is determined at compile time. Hence, it is also known as compile time polymorphism.
4.
When Overloading does not occur?
Explanation: 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.
5.
Which concept of Java is a way of converting real world objects in terms of class?
Explanation: Abstraction is the concept of defining real world objects in terms of classes or interfaces.