Question: Suppose we have list of type List. Which method allows you to pass a List and returns an immutable Set containing the same elements? A.
Suppose we have list of type List. Which method allows you to pass a List and returns an immutable Set containing the same elements?
A. List.copyOf(list)
B. List.of(list)
C. Set.copyOf(list);
D. Set.of(list);
E. None of the above
Step by Step Solution
3.50 Rating (150 Votes )
There are 3 Steps involved in it
The correct answer is C SetcopyOflist The copyOf method in Javas Set interface allow... View full answer
Get step-by-step solutions from verified subject matter experts
