我对 JAVA 很陌生,无法弄清楚 IF 语句的问题
class SpaceRemover {
public static void main() {
String mostFamous= "This is a test";
char[] mfl = mostFamous.toCharArray();
for (int dex = 0; dex < mfl.length; dex++) {
char current = mfl[dex];
if (current != "") {
System.out.print(current);
} else {
System.out.print(".");
}
}
System.out.println();
}
}