Java Inheritance and Method Quiz

Java Inheritance and Method Quiz

12th Grade

7 Qs

quiz-placeholder

Similar activities

Job Production and Mass Customization

Job Production and Mass Customization

12th Grade

10 Qs

Produits avec garantie / sans garantie

Produits avec garantie / sans garantie

1st Grade - Professional Development

12 Qs

Financing Higher Education Vocabulary

Financing Higher Education Vocabulary

9th - 12th Grade

12 Qs

Television Production 1

Television Production 1

6th Grade - University

11 Qs

Renovero

Renovero

1st - 12th Grade

12 Qs

WHERE THE MIND IS WITHOUT FEAR

WHERE THE MIND IS WITHOUT FEAR

KG - Professional Development

10 Qs

HACCP ADR

HACCP ADR

1st - 12th Grade

12 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

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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