JAVA书写HelloWorld
JAVA书写HelloWorld
1.建一个文件夹存放代码
2.新建一个JAVA文件
- 创建txt修改文件后缀名为.java
- helloworld.java
3.编写代码
public class helloworld{
public static void main(String[] args){
System.out.print("Hello, World!");
}
}
4.编译
在cmd窗口的helloworld文件路径中 执行 javac helloworld.java(java文件名)
自动生成一个class文件(helloworld.class)
5.运行class文件,java helloworld.class(class文件名)


浙公网安备 33010602011771号