DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Douglas has posted 12 posts at DZone. View Full User Profile

Turn An Array Into A Collection

03.31.2009
| 5130 views |
  • submit to reddit
        
String[] array = ...;
List<String> list = Arrays.asList( array );
    

Comments

Snippets Manager replied on Wed, 2009/04/01 - 10:27pm

List list = new ArrayList(Arrays.asList(array)); it supports more operation.