inheritance quiz

inheritance quiz

12th Grade

5 Qs

quiz-placeholder

Similar activities

Java OOPs Concepts

Java OOPs Concepts

12th Grade - University

10 Qs

Programming paradigms

Programming paradigms

11th - 12th Grade

10 Qs

Review Materi PBO Part 2

Review Materi PBO Part 2

10th - 12th Grade

8 Qs

Introduction to HTML/CSS Quiz 5: Advanced CSS

Introduction to HTML/CSS Quiz 5: Advanced CSS

6th - 12th Grade

7 Qs

AP CSA - Inheritance, plus one while loop.

AP CSA - Inheritance, plus one while loop.

12th Grade

10 Qs

CodeHS 4.12 Inheritance

CodeHS 4.12 Inheritance

9th - 12th Grade

7 Qs

AP CSA Unit Review #2

AP CSA Unit Review #2

9th - 12th Grade

5 Qs

Unit 9 Quiz 1 Review

Unit 9 Quiz 1 Review

9th - 12th Grade

8 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