在编写文件时要用xx.java文件;运行的时候会变成xx.class文件之后运行
编写具体步骤:
1.新建一个记事本文件;2.更改名字命名为helloworld.java;3.右键编辑;4.敲写如下代码
public class helloworld(必须和文件名一摸一样){
public static void main(String[] args){
System.out.println("Hello,World!!!");
}
};
public class helloworld(必须和文件名一摸一样){
public static void main(String[] args){
System.out.println("Hello,World!!!");
}
};5.保存之后关上;
运行具体步骤:
1.win+R;2.cmd;3.找到编写文件坐在位置cd进去,dir查看目录可见;4.输入:javac helloworld.java(此处后后缀一定不能省略)回车之后稍等一下左侧就出现了helloworld.class;5.运行class文件,输入:java helloworld回车则下一行出现运行结果;
Notepad++(增强版记事本)的使用:
因为记事本编写不容易差错;下载这个软件可以方便很多
编写运行具体步骤同上;