Interfaces

Interfaces

University

10 Qs

quiz-placeholder

Similar activities

Object Oriented Programming Quizz

Object Oriented Programming Quizz

University

10 Qs

Quiz-Session12

Quiz-Session12

University

15 Qs

BioMEMS 2

BioMEMS 2

University

10 Qs

Subcourse B Day 3

Subcourse B Day 3

University

10 Qs

VLAN (Virtual Local Area Network)

VLAN (Virtual Local Area Network)

University

8 Qs

JS QUIZ

JS QUIZ

University

8 Qs

Chapter 5: Network Security and Monitoring

Chapter 5: Network Security and Monitoring

University - Professional Development

15 Qs

Quiz-Session11

Quiz-Session11

University

7 Qs

Interfaces

Interfaces

Assessment

Quiz

Other

University

Medium

Created by

O A

Used 2+ times

FREE Resource

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

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?