package com.cnbn.apollo;
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;
public class test {
public static void main(String[] args) {
String Verid = "2,4,5,10";
String VerIdArray[] = Verid.split(",");
Set<String> verIdTree = new TreeSet<String>((Collections.reverseOrder()));
for (String string : VerIdArray) {
verIdTree.add(string);
}
for (String string : verIdTree) {
if(string.equals("5")){
System.out.println(string);
break;
}else if(string.equals("4")){
System.out.println(string);
break;
}
}
}
}
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;
public class test {
public static void main(String[] args) {
String Verid = "2,4,5,10";
String VerIdArray[] = Verid.split(",");
Set<String> verIdTree = new TreeSet<String>((Collections.reverseOrder()));
for (String string : VerIdArray) {
verIdTree.add(string);
}
for (String string : verIdTree) {
if(string.equals("5")){
System.out.println(string);
break;
}else if(string.equals("4")){
System.out.println(string);
break;
}
}
}
}