Quiz4

Quiz4

University

10 Qs

quiz-placeholder

Similar activities

Chap 1: What is a program made of?

Chap 1: What is a program made of?

University

13 Qs

Guess The Logo

Guess The Logo

5th Grade - Professional Development

15 Qs

21CSC305P - Machnine Learning - Quiz

21CSC305P - Machnine Learning - Quiz

University

15 Qs

Evaluasi Pertemuan 12 DRPL TI-3B

Evaluasi Pertemuan 12 DRPL TI-3B

University

15 Qs

DAA quiz2

DAA quiz2

University

15 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Topic 4-2: Multiple if-else and switch-case

Topic 4-2: Multiple if-else and switch-case

University

10 Qs

1-基本数据类型

1-基本数据类型

University

10 Qs

Quiz4

Quiz4

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Ms. Asst.Prof

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of this keyword must be used to inherit a class?

super

this

extent

extends

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is correct way of inheriting class A by class B?

class B + class A {}

class B inherits class A {}

class B extends A {}

class B extends class A {}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

class A

{

int i;

void display()

{

System.out.println(i);

}

}

class B extends A

{

int j;

void display()

{

System.out.println(j);

}

}

class inheritance_demo

{

public static void main(String args[])

{

B obj = new B();

obj.i=1;

obj.j=2;

obj.display();

}

}

0

1

2

Compilation Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

class A

{

int i;

}

class B extends A

{

int j;

void display()

{

super.i = j + 1;

System.out.println(j + " " + i);

}

}

class inheritance

{

public static void main(String args[])

{

B obj = new B();

obj.i=1;

obj.j=2;

obj.display();

}

}

2 2

3 3

2 3

3 2

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

____________ can be defined as the process where one class acquires the properties (methods and fields) of another.

Overriding

Polymorphism

Inheritance

Abstraction

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The class which inherits the properties of other is known as ________

superclass

subclass

parent class

None of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Subclass also known as ?

derived class

child class

base class

Both A and B

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?