The first step: Use Notepad to edit, Myprogram.java, the source file suffix named. java
Step two: Compile, Javac, build. class file, or bytecode file
Step three: Using the Interpreter, Java
VERBOSE: New Notepad--Change the file name (including suffix name, instead. java)--write program--compile--explain
Test code:
public class helloworld{
public static void Main (string[] args) {
System.out.println ("Welcome to imooc!");
}
}
(If you don't see the file suffix, set it to the folder option)
(It is best to save the program after the root of a disk, note the location, if it is stored in the e-packing directory, the file name is Helloworld.java)
Compile process: Open cmd, enter e:, enter, then enter e disk
Enter dir and enter, then view e packing directory file
Input Javac Helloworld.java, enter, see E disk generated Helloworld.class bytecode file
Explanation Process:
On the basis of the compilation process and then enter the Java HelloWorld, enter (note that at this time HelloWorld do not add the suffix name of Class)
Output Welcome to imooc!, proof of successful compilation
2-writing Java programs using Notepad