Inheritance in Java

Inheritance in Java

University

20 Qs

quiz-placeholder

Similar activities

CS121 OOP

CS121 OOP

University

15 Qs

OOP - Java Classes

OOP - Java Classes

12th Grade - University

15 Qs

OOP in Python

OOP in Python

University

15 Qs

Quiz 3

Quiz 3

University

20 Qs

Behavioral Design Patterns

Behavioral Design Patterns

University

20 Qs

PROGRAMMING CAMP

PROGRAMMING CAMP

University

20 Qs

keistimewaan OOP

keistimewaan OOP

University

15 Qs

Season 2 #Spaic Python Weekly Quiz

Season 2 #Spaic Python Weekly Quiz

KG - Professional Development

20 Qs

Inheritance in Java

Inheritance in Java

Assessment

Quiz

Computers

University

Medium

Created by

Mrs.C. Rathika

Used 207+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The following Syntax is used for?


class Subclass-name extends Superclass-name

{

//methods and fields

}

Polymorphism

Encapsulation

Inheritance

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A class that is inherited is called a ______ .

superclass

Subclass

subsetclass

Relativeclass

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Class Cat extends Animal. Which is NOT a valid declaration?

Cat x = new Cat();

Animal X = new Animal();

Cat x = new Animal();

Animal x = new Cat();

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does polymorphism mean?
Changing shapes
Having many forms
Being unchangeable
Easy

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these cannot be passed down through inheritance?
Public variables
Private variables
Methods
Data

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, each child class can have only one parent.
True
False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When overloading a method, the method header ________ .

Must exactly match the header of the method you are overloading.

Must have the same name, but differ in order, number, or type of parameters.

Can differ in name, but must have the same number and order of parameters.

Can be completely different from the method you are overloading, but must have @Override.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?