1.1(显示三条消息) 编写程序,显示Welcome to Java、Welcome to Computer Science 和 Programming is fun。
1.1 (Display three messages) Write a program that displays Welcome to Java, Learning Java Now, and Programming is fun.
下面是参考答案代码:
public class DisplayThreeMessagesQuestion1 {
public static void main(String[] args) {
System.out.println("Welcome to Java");
System.out.println("Welcome to Computer Science");
System.out.println("Programming is fun");
}
}
运行效果:
注:编程程序要养成良好习惯
如:1.文件名要用英文,具体一点
2.注释要英文
3.变量命名要具体,不要抽象(如:a,b,c等等),形式要驼峰化
4.整体书写风格要统一(不要这里是驼峰,那里是下划线,这里的逻辑段落空三行,那里相同的逻辑段落空5行等等)