MCQ – Java oops concept

Q) Exposing only necessary information to clients ( main programs, classes) is known as
  1. Abstraction
  2. Encapsulation
  3. Data hiding
  4. Hiding complexity

Answer: 1


Q) Hiding the complexity in program is known as
  1. Abstraction
  2. Encapsulation
  3. Data hiding
  4. Composition

Answer: 2


Q) For Cat and Animal class, correct way of inheritance in java is
  1. class Cat extends Animal
  2. class Animal extends Cat
  3. Both are correct way
  4. None is correct way

Answer: 1


Q) In a class, encapsulating an object of another class is called
  1. Composition
  2. Inheritance
  3. Encapsulation
  4. None

Answer: 1


Q) IS-A relationship in java is related to
  1. Inheritance
  2. Encapsulation
  3. Composition
  4. None

Answer: 1


Related Posts