inheritance quiz

inheritance quiz

12th Grade

5 Qs

quiz-placeholder

Similar activities

APCSU1D5 Compound Assignments

APCSU1D5 Compound Assignments

12th Grade

10 Qs

T9 - B12: THÔNG TIN ĐA PHƯƠNG TIỆN

T9 - B12: THÔNG TIN ĐA PHƯƠNG TIỆN

9th - 12th Grade

10 Qs

Embed System#2

Embed System#2

10th - 12th Grade

10 Qs

JSPS Competition Hackathon - Scratch Language - Grade 1

JSPS Competition Hackathon - Scratch Language - Grade 1

2nd Grade - University

10 Qs

Fundamentals of Computing - Unit 5 Quiz 1 Review

Fundamentals of Computing - Unit 5 Quiz 1 Review

12th Grade

10 Qs

QUIZ-I-OBJECT ORIENTED PROGRAMMING WITH C++

QUIZ-I-OBJECT ORIENTED PROGRAMMING WITH C++

10th Grade - University

10 Qs

Computer Applications

Computer Applications

12th Grade

10 Qs

Scratch 2

Scratch 2

KG - University

10 Qs

inheritance quiz

inheritance quiz

Assessment

Quiz

Computers

12th Grade

Practice Problem

Easy

Created by

D Veena

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

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

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?