public class Test01 {
public static void main(String[] args) {
String[] arr = {"12ab","java","45Cd","Server78"};
for (int i = 0; i < arr.length; i++) {
String s = arr[i];
boolean flag1 = s.charAt(0)>='0' && s.charAt(0)<='9';
boolean flag2 = s.charAt(s.length()-1)>='0' && s.charAt(s.length()-1)<='9';
if (flag1 || flag2) {
System.out.println(arr[i].toUpperCase());
}
}
}
}
|