Day04-the first Java program, IDEA installation

Day04-the first Java program, IDEA installation

Hello World

  1. Create a new txt file --> rename it to Hello.java (the name is consistent with the class name class)
  2. Edit with notepad++
  3. Write code
public class Hello{
    
    
    public static void main(String[] args){
    
    
        System.out.print("Hello World!");
    }
}
  1. Enter cmd + "space" at the beginning of the file address bar (enter the directory where the file is located in cmd)
  2. Compile and enter "javac Hello.java" (ie javac + space + file name. extension)
  3. 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();

Guess you like

Origin blog.csdn.net/weixin_46330563/article/details/114683293