inheritance quiz

inheritance quiz

12th Grade

5 Qs

quiz-placeholder

Similar activities

APCSA Inheritance

APCSA Inheritance

10th - 12th Grade

5 Qs

CAI710 - Inheritance

CAI710 - Inheritance

12th Grade

8 Qs

Quarter 4 - LQ1 (Oracle Prog)

Quarter 4 - LQ1 (Oracle Prog)

12th Grade

10 Qs

Java Inheritance

Java Inheritance

11th Grade - University

10 Qs

Review activity Fernandes & Do

Review activity Fernandes & Do

9th - 12th Grade

10 Qs

Review of inheritance & polymorphism

Review of inheritance & polymorphism

12th Grade

6 Qs

OOP Key Terms

OOP Key Terms

12th Grade

7 Qs

AP CSA Unit 9 Inheritance

AP CSA Unit 9 Inheritance

10th - 12th Grade

5 Qs

inheritance quiz

inheritance quiz

Assessment

Quiz

Computers

12th Grade

Easy

Created by

D Veena

Used 1+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to inherit a class in Java?

implement

extends

inherits

derive

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of relationship does inheritance represent in OOP?

Has-a

Uses-a

Is-a

Owns-a

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

class Animal {

void sound() {

System.out.println("Animal makes sound");

}

}

class Dog extends Animal {

void sound() {

System.out.println("Dog barks");

}

public static void main(String[] args) {

Dog d = new Dog();

d.sound();

}

}

Animal makes sound

Dog barks

Compilation error

Runtime error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not true about inheritance in Java?

A subclass inherits all members of the superclass

Private members of the superclass are accessible in the subclass

Constructors are not inherited

A subclass can override non-final methods of the superclass

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following inheritance types does Java support directly?

Multilevel inheritance

Multiple inheritance using classes

Hybrid inheritance

Multipath inheritance