Java Inheritance and Method Quiz

Java Inheritance and Method Quiz

12th Grade

7 Qs

quiz-placeholder

Similar activities

Vérification transmission du pouvoir exercice 4

Vérification transmission du pouvoir exercice 4

12th Grade

8 Qs

Un programme : l'accès à une foule d'options pour la suite!

Un programme : l'accès à une foule d'options pour la suite!

10th - 12th Grade

10 Qs

TOWNHALL - CIALBR

TOWNHALL - CIALBR

1st - 12th Grade

7 Qs

RC Plans and Pricing

RC Plans and Pricing

KG - Professional Development

10 Qs

arduino

arduino

12th Grade

6 Qs

Chapter 10

Chapter 10

9th - 12th Grade

12 Qs

La connaissance de nos métiers !

La connaissance de nos métiers !

9th - 12th Grade

10 Qs

Power Systems & Solutions Injury Quiz

Power Systems & Solutions Injury Quiz

12th Grade - University

10 Qs

Java Inheritance and Method Quiz

Java Inheritance and Method Quiz

Assessment

Quiz

Professional Development

12th Grade

Medium

Created by

COY DUANE WEBB

Used 14+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is inheritance in Java?

Creating a new class using an existing class

Overloading methods

Changing the behavior of a superclass

Creating multiple instances of a class

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do we declare a PainterPlus class in the Painter superclass?

public void painterplus extends painter

public void PainterPlus extends Painter {

public class PainterPlus extends Painter() {

public class PainterPlus extends Painter {

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

True or False: A superclass can use methods from a subclass.

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do we instantiate an object in the PainterPlus class?

PainterPlus = new PainterPlus();

PainterPlus painter = new PainterPlus();

new PainterPlus Painter();

Painter painter = PainterPlus();

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct while loop to make the painter continuously move until it can't?

while (canMove()) { move();

}

while (canMove); { move();

}

while (isMoving()) { move();

}

while (canMove()) { stop();

}

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to write a method paintToEmpty that makes the painter paint until it runs out of paint?

public void paintToEmpty() { while (hasPaint()) { paint(); } }

public void paintToEmpty() { while (canPaint()) { paint(); } }

public void paintToEmpty() { while (isPainting()) { paint(); } }

public void paintToEmpty() { while (hasPaint()) { stop(); } }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to inherit a class in Java?

implements

extends

inherits

super