day2——helloworld

helloworld

  1. 随便新建一个文件夹,存放代码 (code:代码)

  2. 新建一个java文件

    • 文件后缀名.java
    • 创建hello.java
    • 【注意点】系统可能没有显示文件后缀名,我们需要动手打开
  3. 编写代码

    1 public class Hello{
    2 	public static void main(String[] args){
    3 		System.out.print("Hello,World");
    4 	}
    5 }
    
  4. 编译:cmd下输入 javac java文件

  5. 运行class文件:cmd输入 java class

可能遇到的情况

  1. 每个单词的大小不能出现问题,java是大小写敏感的
  2. 尽量使用英文;
  3. 文件名 和类名一定要一致,并且首字母大写
  4. 符号使用了中文符号
posted @ 2020-11-14 21:17  全科图书馆  阅读(61)  评论(0编辑  收藏  举报