阿阿影
public class Compare {
public static void main(String[] args){
char[] c1 = new char[]{'a', 'b', 'd', 'd'};
char[] c2 = new char[]{'a', 'c', 'c', 'd'};
boolean isFinished = false;
for(int i = 0;i < c1.length;i++){
if(c1[i] > c2[i]){
System.out.println("c1 is bigger.");
isFinished = true;
break;
}else if(c1[i] < c2[i]){
System.out.println("c2 is bigger.");
isFinished = true;
break;
}
}
if(!isFinished){
System.out.println("c1 is the same as c2.");
}
}
}