Search Header Logo

Unit-2 Revision quiz

Authored by Ms STAFF

Professional Development

Professional Development

Used 5+ times

Unit-2 Revision quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one is correct declaration for implementing two interfaces?

class C implements A, B {}

class C implements A, implements B {}

class C implements A extends B {}

class C extend A, B {}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

which type of inheritance is not allowed in java directly

Multi level

Multiple

Hierarhical

single

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose the class Undergraduate extends the class Studentwhich extends the class Person. Given the following variable declaration:

Person p = new Person();

Student s = new Student();

Undergraduate ug = new Undergraduate();

Which of the following assignments are legal?

p =ug;

p = newUndergraduate();

ug = newStudent();

ug =p;

s = newPerson();

I andIV

III, II andIV

I and II

III andIV

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the result of this code will be?

Interface A {

inti =111;

}

class B implements A { void methodB(){

i =222;

System.out.printl(i);

}

}

There is no main () method so the program is notexecutable.

The value of i will be printed as 111, as it is static and final bydefault.

The value of i will be printed as 222, as it is initialized in classB.

Compile timeerror

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

which keyword is used to inherit the properties from a class

impements

extends

final

static

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can we inherit all the properties from parent class

yes all the propeties canbe inherited

yes all the properties except private property

yes all the properties except protected property

yes all the properties except default property

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Multiple inheritances in java can be achieved in java using

packages

classes

interfaces

none

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?