public class HelloWorld{
public static void main(String[] args) {
final String NAME="Drarchao";
final char sex1='男';
final char sex2='女';
System.out.println(sex1);
System.out.println(sex2);
System.out.println(NAME+sex1+" is "sex2);
}
}
帮忙找出里面的错误,不懂啊
System.out.println(NAME+sex1+" is "sex2);
这一行缺了连接符,字符串和变量之间需要加连接符
public class HelloWorld{ public static void main(String[] args) { final String NAME="Drarchao"; final char sex1='男'; final char sex2='女'; System.out.println(sex1); System.out.println(sex2); System.out.println(NAME+sex1+" is "+sex2); } }