Coding Java
the java filename should be the same as the name behind class statement, extention should be .java.
class FirstJava {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
ComplieTool:
-
javac.exe
complie java file, generate .class file
C:\Users\Janus_admin\Documents\Oth\java>javac FirstJava.java
-
java.exe
execute the .class file, return the result.
Attention: this step please don't add the extention
C:\Users\Janus_admin\Documents\Oth\java>java FirstJava
Hello, world!
网友评论