9/2022 Core Java Day -8 ( Set) M.
Praveen
Q.1.1. Create a HashSet for the below values
Input : List = 10,20,30,40,50,60,70,80,90,10,20
Q.1.2. Create a LinkedHashSet for the below values
Input : List = 10,20,30,40,50,60,70,80,90,10,20
Q.1.3. Create a TreeSet for the below values
Input : List = 10,20,30,40,50,60,70,80,90,10,20
Q.2.1. Convert the below list in to set(use addAll()) method
Input : List = 10,20,30,90,10,10,40,50
Q.2.2. Convert the below list in to set(use addAll()) method
Input : List = 105,205,305,405,505,605,705,805,505,605
Q.2.3. Convert the below list in to set(use addAll()) method
Input : List = 100,200,300,400,500,600,700,100,300,500
Q.3.1. 3.2 and 3.3 Get the each value of set by using enhanced for loop
Input: List = 105,205,305,405,505,605,705,805
Q.4.1. Create a new HashSet with values and return the common values
Input : List = 10,20,30,90,10,10,40,50
Input : List = 30,40,50,60,80
Q.4.2. Create a new LinkedHashSet with values and return the common
values
Input : List = 10,20,30,90,10,10,40,50
Input : List = 10,20,60,50,40,70,80,90
Q.4.3. Create a new TreeSet with values and return the common values
Input : List = 10,20,30,40,50,60,70,80
Input : List = 100,200,300,400,500,600,700,8000
Q.5.1. Create a new HashSet with values and perform removeAll()
function
Input : List = 10,20,30,90,10,10,40,50
Input : List = 30,40,50,60,80
Q.5.2. Create a new LinkedHashSet with values and perform removeAll()
function
Input : List = 10,20,30,90,10,10,40,50
Input : List = 10,20,60,50,40,70,80,90
Q.5.3. Create a new TreeSet with values and perform removeAll()
function. Input : List = 10,20,30,40,50,60,70,80
Input : List = 100,200,300,400,500,600,700,8000