Custom sorting using comparator

Custom sorting using comparator

Professional Development

37 Qs

quiz-placeholder

Similar activities

JS array & object

JS array & object

Professional Development

37 Qs

Informatika PTS

Informatika PTS

Professional Development

35 Qs

Teachers Evaluation 3 - Thunkable

Teachers Evaluation 3 - Thunkable

Professional Development

40 Qs

Technical MCQs

Technical MCQs

Professional Development

35 Qs

CORSAIR TRIVIA NIGHT #10

CORSAIR TRIVIA NIGHT #10

Professional Development

36 Qs

LPI Linux Essentials (40 Questions)

LPI Linux Essentials (40 Questions)

Professional Development

40 Qs

DBMS QUERY LONG QUIZ

DBMS QUERY LONG QUIZ

Professional Development

35 Qs

ICDL Excel

ICDL Excel

Professional Development

40 Qs

Custom sorting using comparator

Custom sorting using comparator

Assessment

Quiz

Computers

Professional Development

Hard

Created by

ANIL KUMAR

FREE Resource

37 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is custom sorting using a Comparator?
a) Sorting with natural order.
b) Sorting using Comparable interface.
c) Sorting using custom functions.
d) Sorting using Collection.sort() method.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to sort custom objects in Java using Comparator?
a) Use natural sorting.
b) Implement Comparator class.
c) Use Arrays.sort() only.
d) Use Comparable interface.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does Java sort with Comparator?
a) Sort using Comparable only.
b) Sort using Arrays.sort() method.
c) Sort using custom logic.
d) Sort using Comparator for custom order.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does custom Comparator work in Java?
a) Compares objects using Comparable.
b) Uses natural ordering for sorting.
c) Compares objects using custom logic.
d) Compares objects using equals() method.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is custom sorting in Java?
a) Sorting using Comparable interface.
b) Sorting with natural order.
c) Sorting based on multiple comparators.
d) Sorting using custom comparators.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is custom sorting?
a) Sorting based on default measures.
b) Sorting using built-in methods.
c) Sorting by clicking column headers.
d) Sorting using natural order.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to sort list in custom order in Java?
a) Sort using natural order.
b) Use List.sort() method only.
c) Use Collection.sort() method.
d) Sort using external Comparator.

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?