Here is a example which demonstrates conversion of Array to Set in Java
Example: Java Array to Set
String [] countires = { "India" , "Switzerland" , "Italy" }; Set<String> set = new HashSet<String>(Arrays.asList(countires)); System.out.println(set); |
[Italy, Switzerland, India]
No comments:
Post a Comment