Day04-the first Java program, IDEA installation
Hello World
- Create a new txt file --> rename it to Hello.java (the name is consistent with the class name class)
- Edit with notepad++
- Write code
public class Hello{
public static void main(String[] args){
System.out.print("Hello World!");
}
}
- Enter cmd + "space" at the beginning of the file address bar (enter the directory where the file is located in cmd)
- Compile and enter "javac Hello.java" (ie javac + space + file name. extension)
- Run , enter "java Hello", and press Enter
Precautions:
- Capitalization issues (String and System are capitalized)
- All symbols use English half-width
- The file name is consistent with the class name (the first letter is capitalized)
Compiled, interpreted
-
Compilation type: compile all at once, and then run
After the code changes, you need to recompile all
-
Interpretation: compile one sentence and run one sentence
Code execution efficiency is low, suitable for websites, etc.
IDEA
IDE: Integrated Development Environment (IDE, Integrated Development Environment) is an application used to provide a program development environment, which generally includes tools such as a code editor, a compiler, a debugger, and a graphical user interface. Integrated development software service suite with code writing function, analysis function, compilation function, debugging function, etc.
Common abbreviations and abbreviations:
-
psvm = public static void main(String[] args){}
-
sout = System.out.println();