Tuesday, October 27, 2015

Core Java - How to convert the array of strings into the list ?



Arrays class of java.util package contains the method asList() which accepts the array as parameter.
So,

String[]  wordArray =  {"Love Yourself"  , "Alive is Awesome" , "Be in present"};
List wordList =  Arrays.asList(wordArray);

No comments:

Post a Comment