MCQ – Java oops concept

Q) If you want to write multiple functions in a class with same name, then what Java feature will you use?
  1. Function overriding
  2. Encapsulation
  3. Function overloading
  4. None

Answer: 3


Q) Polymorphism types in Java is/are
  1. Compile time
  2. Run time
  3. Both
  4. None

Answer: 3


Q) If I want to have common functions in a class and want to defer implementations of some other functions to derived classes, then we need to use
  1. An interface
  2. An abstract class
  3. A static class
  4. None

Answer: 2


Q) Loose coupling in java programs can be done by
  1. Using interface
  2. Encapsulating an object of another class
  3. Both
  4. None

Answer: 1


Related Posts