// To CONVERT ARRAYS INTO 'COLLECTIONS'
import java.util.*;
class ArrayToCollection
{
public static void main(String[] args)
{
String[] s ={"ashutosh", "kumar","Singh"};
ArrayList<String> al =new ArrayList<String>(Arrays.asList(s));
al.add("SE");
al.add("WD");
System.out.println(al);
}
}
Thanks
Happy programming!
import java.util.*;
class ArrayToCollection
{
public static void main(String[] args)
{
String[] s ={"ashutosh", "kumar","Singh"};
ArrayList<String> al =new ArrayList<String>(Arrays.asList(s));
al.add("SE");
al.add("WD");
System.out.println(al);
}
}
Thanks
Happy programming!
No comments:
Post a Comment