B4 - The Comparable Interface

B4 - The Comparable Interface

University

10 Qs

quiz-placeholder

Similar activities

Guess the blackpink song lyrics

Guess the blackpink song lyrics

4th Grade - Professional Development

10 Qs

QUIZ ON INDEPENDANCEDAY

QUIZ ON INDEPENDANCEDAY

KG - University

15 Qs

Dr. Vikram Sarabhai

Dr. Vikram Sarabhai

6th Grade - University

10 Qs

Film quiz

Film quiz

7th Grade - Professional Development

10 Qs

General knowledge Quiz

General knowledge Quiz

University

10 Qs

only check box but some only one answer

only check box but some only one answer

KG - University

11 Qs

MR_07_observation

MR_07_observation

University

10 Qs

ANIME!!

ANIME!!

5th Grade - Professional Development

10 Qs

B4 - The Comparable Interface

B4 - The Comparable Interface

Assessment

Quiz

Other

University

Practice Problem

Medium

Created by

Ahmetcan türk

Used 6+ 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

An interface, in general, is a list of what things?

methods and variables

classes and constants

methods

methods and constants

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Say that you are writing a class Book and wish it to implement the Comparable<Book> interface. What method must Book contain?

int compareTo( Book other )

int compareTo( Object other )

Book compareTo( Object other )

boolean compareTo( T other )

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of "zebra".compareTo("emu")

a negative integer

0

a positive integer

unpredictable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of (new Integer(5)).compareTo( new Integer(8) )

a negative integer

0

a positive integer

unpredictable

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If the objects of a class are arranged into their natural order, then if object L is left of object R what is true?

L.compareTo(R) is positive

L.compareTo(R) is negative

L.compareTo(R) is zero

R.compareTo(L) is negative

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If X.compareTo(Y) is positive, then which of the following is true?

Y.compareTo(X) is positive

Y.compareTo(X) is negative

Y.compareTo(X) is zero

Y.compareTo(X) is unknown

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If X.equals(Y) is true, then which of the following is true for most classes that implement Comparable?

X.compareTo(Y) is negative

X.compareTo(Y) is zero

X.compareTo(Y) is positive

Nothing can be said.

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?