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

1 Expert Approved Answer
Step: 1 Unlock

The correct answer is C SetcopyOflist The copyOf method in Javas Set interface allow... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!