Alex Rivera | Logout

Convert Collection to List

Asked 2010-03-18T15:08:29.827
51

I would like to ask: how do you convert a Collection to a List in Java?

Edit
Report

1 Answer

71
Collection<MyObjectType> myCollection = ...;
List<MyObjectType> list = new ArrayList<MyObjectType>(myCollection);

See the Collections trail in the Java tutorials.

answered 2010-03-18T15:09:39.627

Your Answer