Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 1.28 KB

SetsCheatSheets.md

File metadata and controls

20 lines (16 loc) · 1.28 KB

Set methods to Know

Method Return Type Parameters
add() boolean (E element)
remove() boolean (Object object)
isEmpty() boolean none
size() int none
clear() void none
contains() boolean (Object object)
equals() boolean (Object object)
hashCode() int none

Creating Sets

Method Info Add Elements? Remove Elements? Replace Elements?
Set.of(varargs) Immutable No No No
Set.copyOf(collection) Immutable with given collection No No No