我不确定为什么我的 Java 代码无法编译,任何建议都将不胜感激。
String rank = card.substring(0,1);
String suit = card.substring(1);
String cards = "A23456789TJQKDHSCl";
String[] name = {"Ace","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King","Diamonds","Hearts","Spades","Clubs"};
String c ="";
for(int a = 0, b = 1; a<cards.length-1; b=a+1; a++;){
if(rank===cards.substring(a,b){
c+=name[a];
}
}
system.out.println(c);