1. Java Development Environment Overview
Jdk:java Development Kit (Java Development Kit), including Java compilers, Java Runtime Environments, and commonly used class libraries;
Jre:java Runtime Environment (Java Runtime Environment).
2. Cross-platform features
① platform refers to the operating system (WINDOWS,LINUX,MAC)
②java programs can be run on any operating system, once written and run everywhere
③ implementing a Java-dependent virtual machine JVM for cross-platform use (Java virtual machines)
3. Setting of Environment variables
JAVA_HOME:JDK Path
Path: Add%java_home%\bin;
Input JAVAC-VERIOSN Test succeeded
4. Successfully compiled and run, output Hello world!
5. Use Advanced Notepad notepad++
6. Comments
Role: Explanatory notes, easy to read
Single-line Comment://I am a comment
Multiline Comment:/* I am comment */
Document Comments:/** comments */
7. Key words
The keywords in Java are lowercase
8. Identifiers
Composition rules: Letters 52 A-Z, a-Z, number 0-9, underscore (_), dollar sign ($), cannot start with a number, cannot be a keyword
Class Name: First Capital, first letter of the second word
Method Name: First letter lowercase, each word capitalized
9. Data
program = data + logic
Data type: base data type, reference data type (array, class, interface)
10. Constants
Integer type:
Decimal: The numbers that are often in life
Binary: Start with 0b, such as 0b1001;
Hex: Starting with 0x, the number is composed of 0-9 and a-f, such as 0xa;
Octal: Starting with 0, such as 07
Decimal type:
such as 1.0
Boolean type:
True, False
Character type:
Characters must be enclosed in single quotes and can contain only one character;
String constants:
String type is a reference type and must be wrapped in double quotation marks, which can contain 0-n characters.
01day_java Basic Syntax