Home >Java >javaTutorial >What are the basic concepts of Java?
1. The father of java: James Gao Jialin
2. Key time points: Java (1.0) was released in 1996, Java (5.0) was carried forward in 2004, Java (8.0) was the most widely used in 2014, and Java (16.0) is used this time in 2021.
Principle: Different platforms have corresponding Java virtual machines (JVM)
JRE is an environment used to run Java programs, including JVM and core class libraries
JDK is a Java development tool kit, including JRE and development tools (including compilation tools javac.exe and Running tool java.exe)
That is, JDK includes JRE and development tools, and JRE includes cross-platform JVM and core class library
Official website link
Baidu cloud link, extraction code: bjcp
The directory after installation has the following parts:
win R into CMD, cut disk, dir, cd, cls, exit commands
This is to add the bin directory to the system variable, and everything after jdk16 is ready
1. Create a new HelloWorld.java file
2. Open the HelloWorld.java file with Notepad and write the content
public class HelloWorld {public static void main(String[] args){System.out.println("HelloWorld");}}
3. After jdk11, you can directly use java&HelloWorld.java. If the program will output Chinese, then in Add -encoding&UTF-8
## after 7. NotepadThis is convenient for displaying line numbers. It will be uneasy to use IDE later 8. NoteSingle line: //
Document:/**&*/
9. Keywords
11. Data types
12. Variables
Format
: data type&variable type=variable valueNote: Add L after long type and F
Format
: 1. It consists of numbers, letters, and $; 2. It cannot start with a number; 3. It cannot be a keyword; 4. It is case-sensitive. Method and variable convention (little camel case naming method) : 1. When the identifier is one word, the first letter is lowercase; 2. The identifier is composed of multiple words When the first letter of the first word is lowercase, the first letter of the other words is capitalized.
Class convention (large camel case nomenclature): 1. When the identifier is one word, the first letter is capitalized; 2. When the identifier is composed of multiple words, Capitalize the first letter of each word.
1. Automatic type conversion
: A value representing a small data range or a variable assigned to another variable representing a large data range2. Forced type conversion: A value or variable representing a large data range is assigned to another variable representing a small data range (add A forced conversion is enough)
The above is the detailed content of What are the basic concepts of Java?. For more information, please follow other related articles on the PHP Chinese website!