Interfaces

Interfaces

University

10 Qs

quiz-placeholder

Similar activities

Driving Theory Test: Alertness

Driving Theory Test: Alertness

KG - Professional Development

10 Qs

Conditional Statements : Quiz - 4

Conditional Statements : Quiz - 4

University

12 Qs

Meme Quiz

Meme Quiz

1st Grade - Professional Development

8 Qs

Red Queen

Red Queen

KG - University

10 Qs

Neurotransmitter

Neurotransmitter

University - Professional Development

15 Qs

Discounted Room rates

Discounted Room rates

University

10 Qs

Labor Relations and Negotations 1

Labor Relations and Negotations 1

University - Professional Development

15 Qs

DISEASES & DISORDERS #1

DISEASES & DISORDERS #1

7th Grade - University

12 Qs

Interfaces

Interfaces

Assessment

Quiz

Other

University

Practice Problem

Medium

Created by

O A

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

All methods in an interface are:

private

protected

public abstract

public final

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, interfaces can have:

Static and default methods

Constructors

Private fields

Synchronized methods

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if two interfaces define a constant int x = 10; and a class implements both?

No problem, it's allowed

Compilation error if accessed without qualification

Runtime error

x will take value from the first interface

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the keyword instanceof check?

Object reference equality

Object memory location

Whether an object is an instance of a class or interface

Whether two classes are the same

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to access a constant from an interface?

x

this.x

InterfaceName.x

new Interface().x

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true?

You can create an instance of an interface using new

An interface can implement another interface

Interfaces can have private methods

A class can implement multiple interfaces

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Who is the class user in software design?

The one who extends a class

The one who defines methods

The one who calls/uses the class

The one who inherits constants

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?