Search Header Logo

JPRG Topic 2-2 Inheritance and Polymorphism

Authored by Alvin Tang

Computers

University

Used 10+ times

JPRG Topic 2-2 Inheritance and Polymorphism
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In a class declaration "public class Student extends Person", the Student class is the ___

parent class

extended class

subclass

my class

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following will implement the relationship as shown?

public class Car import Vehicle

public class Vehicle import Car

public class Vehicle extends Car

public class Car extends Vehicle

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

If the Triangle class is a sub-class of the Shape class, is the given code valid?

True

False

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

In the code snippet shown, the greetings() method is _

overlorded

overloaded

overridden

overwritten

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which access modifier will allow the name and age properties to be accessible from subclasses of Person?

private

protected

inherited

protect

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The super keyword allows subclasses to call methods and properties from the parent class.

No

Yes

Maybe?

I guess. Who am I to judge?

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers