import java.util.Arrays; import java.util.Set; import java.util.TreeSet; public class Tester extends Thread { public static void main(String[] args) { Integer[] arr = {7,5,7,3}; Set<Integer> set = new TreeSet<Integer>(Arrays.asList(arr)); set.add(4); for(Integer value: set){ System.out.print(value); } } }
import java.util.Set;
import java.util.TreeSet;
public class Tester extends Thread {
public static void main(String[] args) {
Integer[] arr = {7,5,7,3};
Set<Integer> set = new TreeSet<Integer>(Arrays.asList(arr));
set.add(4);
for(Integer value: set){
System.out.print(value);
}
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.