Core Java 10: Optionals, Tiers, Layers, Custom Objects, Sorted Collections Flashcards

(7 cards)

1
Q

Optional

A

wrapper class used as a return type for methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why are optionals useful?

A

Optionals are used for communication; Optional is a wrapper class representing that a method returns null to represent a lack of a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Layer

A

a layer is a group of components that are reusable in similar circumstances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Tier

A

a group of layers; examples include data tier, client tier, middle tier, business tier, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Collection

A

an iterable group of objects bound together by a DSA (List, Queue, or Set), as distinguishable from a Map

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you set up sorting of custom objects in java?

A

Use Collections.sort() method; to do this, need to create a comparator and pass it as an argument to Collections.sort()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a sorted collection?

A

a sorted collection uses the Collections.sort() method (and usually a custom comparator object) to sort the collection in a specialized way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly