Java code
public class PrintWords {
public static void main(String[] args) {
System.out.println(
Words.FIRST + " " + Words.SECOND + " " + Words.THIRD
);
}
}
public class Words{
public static final String FIRST = "the";
public static final String SECOND = null;
public static final String THIRD = "set";
}
编译PrintWords.java文件。
修改Words.java文件为
Java code
public class Words{
public static final String FIRST = "physics";
public static final String SECOND = "chemistry";
public static final String THIRD = "biology";
}
问题:再次编译运行PrintWords.java,打印结果是什么?
|
|