Java常量的应用中final String为什么不能用final char,后面定义常量值为单字符啊?
public class HelloWorld{
public static void main(String[] args) {
final char sex="男";
final char sex1="女";
System.out.println(sex);
System.out.println(sex1);
}
}
public class HelloWorld{
public static void main(String[] args) {
final char sex="男";
final char sex1="女";
System.out.println(sex);
System.out.println(sex1);
}
}
2019-01-15
举报