来自公开披露的考试的问题阅读"写一个声明两个变量a和b的声明,并用值7.3和" Goodbye"初始化它们。 "
关键答案:
double d = 7.3; //or float f = 7.3; (they must have 7.3f, but we will accept 7.3)
String message = “Goodbye”;
这是一个错字吗?这看起来像是对我的两个陈述,除非我把声明的定义混淆了。
答案 0 :(得分:0)
Write a single statement that declares two variables, a and b, and initializes them with the values 7.3 and “Goodbye”. (Choose an appropriate type.)
来自here。根据'选择合适的类型',我会说:
private String a = "7.3", b = "Goodbye";