Day 11

Day 11

1st - 5th Grade

15 Qs

quiz-placeholder

Similar activities

Cartões criativos

Cartões criativos

2nd Grade - University

10 Qs

Ela suku tertutup (jawi tahun 4)

Ela suku tertutup (jawi tahun 4)

4th Grade

20 Qs

BANGGA JADI ANAK INDONESIA

BANGGA JADI ANAK INDONESIA

4th - 6th Grade

10 Qs

Quiz 1

Quiz 1

1st - 3rd Grade

14 Qs

FontysVenlo - PRC1 - W01

FontysVenlo - PRC1 - W01

1st - 3rd Grade

13 Qs

Introducción a Pyhton

Introducción a Pyhton

1st Grade

12 Qs

Receso escolar

Receso escolar

2nd Grade - University

12 Qs

Day 11

Day 11

Assessment

Quiz

Education

1st - 5th Grade

Hard

Created by

DATTA SAI SANTHOSH

Used 3+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between method overloading and method overriding?

Method overloading is static polymorphism, while method overriding is dynamic polymorphism.

Method overloading is used in inheritance, while method overriding is used in abstraction.

Method overloading is when a subclass provides a different implementation of a method, while method overriding is when a subclass has multiple methods with the same name.

Method overloading is used for access control, while method overriding is used for code reusability.

Answer explanation

Method overloading is static polymorphism, while method overriding is dynamic polymorphism

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a benefit of using packages in Java?

Encapsulation and information hiding

Improved code reusability

Easy management of large projects

Faster execution of Java programs

Answer explanation

Faster execution of Java programs

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is/are not advantages of packages?

packages avoid name clashes.

classes even though they are visible outside their package, can have visible to packages only

we have hidden classes that are used by the packages, but not bisible outside.

all the above

Answer explanation

classes even though they are visivle outside theor package,can have visible to packages only

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

// Note static keyword after import.

import static java. lang. System.*;

class StaticImportDemo

{

public static void main(String args[])

{

out.println("wipro training");

}

}

Wipro training

compile Error

Runtime error

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to establish inheritance in Java?

inherits

extends

inheritsFrom

implements

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of the following program.?

abstract class demo

{

public int a;

demo()

{

a = 10;

}

abstract public void set();

abstract final public void get();

}

class Test extends demo

{

public void set(int a)

{

this.a = a;

}

final public void get()

{

System.out.println("a = " + a);

}

public static void main(String[] args)

{

Test obj = new Test();

obj.set(20);

obj.get();

}

}

Compilation error

a=10

a=20

Runtime error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can an interface contain variables?

Yes, only static variables.

Yes, only final variables.

No, interfaces cannot have variables

Yes, but they must be final and static.

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?