Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

COLLECTIONS SET _HASHSET

Add adds all the data into a single array or collection (duplicate value is not added )

No order is maintained

Eg s.add(1) s.add(2) s.add(1) prints 2 1

Size prints the over size of the given data

Contains checks for given data in the values

Clear removes all the data in collection

Addall adds all the data of two different collections

Eg i= 1 2 3 i1=2 3 4 prints 1234

Retainall prints the data that are common in both array

Eg prints 123

Remove all removes the common value and prints the value of the first string

Eg 1

You might also like