khameed
Quiz by , created more than 1 year ago

This Quiz aims to test the basic objective of inheritance

48
0
0
khameed
Created by khameed about 9 years ago
Close

Overriding

Question 1 of 5

1

One of the main concepts in OOP is _____________ That allows to use the features ( methods )of one class in another?

Select one of the following:

  • Libraries

  • Inheritance

  • polymorphism

  • abstraction

Explanation

Question 2 of 5

1

Identify the child class in the java statement. public class Student extends Person{

Select one of the following:

  • public

  • Student

  • Person

  • extends

Explanation

Question 3 of 5

1

In Method Overriding the following the following conditions hold. Select more than one that apply

Select one or more of the following:

  • Child class method must have same name as in the parent class.

  • Child class method must have same parameter as in the parent class.

  • Child class method must have same return type as in the parent class

  • Child class method must have different name as in the parent class.

  • Child class method must have different return type as in the parent class

  • Child class can have different method signature

Explanation

Question 4 of 5

1

Inheritance enhances the ability to reuse existing code.

Select one of the following:

  • True
  • False

Explanation

Question 5 of 5

1

An object of a sub class can not be referenced by a variable of a super class type

Select one of the following:

  • True
  • False

Explanation