1. Introduction:
Java is an object-oriented, high-level programming language.
2. Java includes:
Javase (Java Foundation) Java EE (Java Enterprise Application)
First, write Java program with Notepad
1. Create a Java source file with a. java extension
2. Compile the Java source file and produce a bytecode file with a. class extension
In the DOS command window, enter [Javac file name. java] and return
3. Execute Java Program
In the DOS command window, enter [Java file name] and return
Ii. framework of Java programs
1.java Order of execution
Java (compile) Java (run)
Write source-----------> loadline file-----------> Execute
2. public class name {
public static void Main (string[] args) {
// in this method, the output information
System. Out. println (" content to output ");
}
}
★ Precautions: (1) The class name must be the same as the file name, and the first letter of the class name is uppercase;
(2) parentheses should appear in pairs.
(3) (String) must be uppercase s;
(4) system starts with uppercase S;
(5) all symbols () {}, (),; "" are all entered in the English state;
(6) A program can have only one main () method;
The difference between 3.println and print
PRINTLN will break.
Print does not
4. Escape character
\ n = line break
\ t denotes a space
5.java comments
: Single-line comment
/* * *: Multi-line Comment
/** * * indicates a text comment
First knowledge of Java