wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java-10 Interface

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

An interface _________ another interface

a)

implements

b)

joins

c)

extends

d)

implement

2.

An interface extends a class

a)

True

b)

interface implements a class

c)

Arithmetic Exception

d)

Compiler Error

3.

What will be the output?

a)

Nothing

b)

10

c)

Compile time error

d)

Runtime Exception

4.

Inside an interface, every method is public and abstract.

a)

TRUE

b)

FALSE

5.

All the methods inside an abstract class should be ___________

a)

abstract

b)

final

c)

well defined

d)

public

6.

The interface methods can be made final.

a)

TRUE

b)

FALSE

7.

What is the output?

a)

Compiler Error

b)

Happy Holi

c)

Run time Exception

d)

No error, No output

8.

The scope of an interface method implemented in a class (overridden) must be

a)

always private

b)

always less than the scope of interface method

c)

always more than the scope of interface method

d)

always public

9.

Object creation for Interface and abstract class..

a)

Cannot be created for both

b)

Can be created for Interface

c)

Can be created for Abstract class

d)

Can be created for both

10.

We prefer using interface when __________, and an abstract class when ______________.

a)

classes are not required, interfaces are not required

b)

we don't know any implementation, we know partial implementations

c)

we know every implementation, we know partial implementation

d)

we work on Java, we work on C++; It depends on language