Summary of basic knowledge points of Java entry

1. Development of computer language

Machine language, assembly language, high-level language (C/C++, Java, etc.)

2. Java history

1991 oak (predecessor of Java)
changed to Java in May 1995 and launched
James Gosling, the father of Java

3.Java features

(1) Object-oriented. It can be understood as a task boss assigned to employees, employees need to consider the way the task is completed, the way the task is carried out and realized, that is, the employee needs to control the process of the task, and the employee is process-oriented. The boss only needs to assign tasks to employees, and does not need to consider the execution process of the tasks. It can be said that the boss is object-oriented.
(2) Platform independent. Mainly for the difference of Windows and Linux operating systems, it can run across platforms. The reason is that the Java source code we write is compiled by the compiler to generate a .class file. At this time, the JVM (Java Virtual Machine) is converted into machine code that can be recognized by the computer. Since JVM can be converted to machine code recognized by Windows or Linux, cross-platform operation is essentially realized through JVM.
(3) Java is a quasi-dynamic strongly typed interpreted language.

4. Four major features of JVM

(1) Cross-platform
(2) Multithreading
(3) Object-oriented
(4) Automatic garbage collection mechanism

5. What is a dynamic language? What is a static language?

(1) Dynamic language
There is no need to determine the data type when using variables. The data type is determined at the first assignment, and the assignment is issued at runtime. The structure of the program can be changed while it is running. New functions can be introduced, existing functions can be deleted and other structural changes, and type checking is done at runtime. The advantage is easy to read and clear. The disadvantage is that it is not convenient to debug.
(2) Static language
When compiling, it can also be understood that the data type needs to be determined before running. And the corresponding space can only store the value of the specified type.

6. What is a strongly typed language? What is a weakly typed language?

(1) Strongly typed language
Strongly typed language, also known as strongly typed definition language, is a language that always enforces type definition. Variables are required to strictly conform to the definition when they are used, and all variables must be defined before use. Once the data type is determined, the type cannot be changed (unless a forced type conversion is used), and values ​​of different types cannot be added and other operations.
(2) Weakly typed languages
change data types according to context changes, and do not require type conversion.

7. What is a compiled language? What is an interpreted language?

(1) Compiled language
The source code is compiled into an executable machine code of a specified platform at one time through a specified compiler, and then executed. The running speed is faster.
(2) Interpreted language
Use a special interpreter to dynamically interpret the source code (interpret as much as you run) to generate easy-to-execute intermediate code. This kind of intermediate code is different from machine code and cannot be recognized by a computer. It needs to be interpreted by a special software interpreter, interpreted as machine code, and then executed. Therefore, due to the intermediate process, the running speed will be slower.

8. Why is Java quasi-dynamic?

This is mainly reflected in Java's reflection mechanism, dynamic compilation, dynamic execution, JavaScript code, dynamic bytecode operations, and dynamic conversion types. Therefore, Java preserves the characteristics of a static language and makes up for the lack of a static language. It is closer to the characteristics of a dynamic language. Java is said to be quasi-dynamic.

9. Java development specifications

① Java is strictly case sensitive. For example: Public and public are not the same.
② There can be multiple classes in a Java file.
③There can be only one public class in a Java file, and the public class name must be consistent with the file name.
④The entrance of the Java Application program is the main method. That is: public static void main (String[]args ){ }. The writing method is fixed, and public must be added in front of the class containing the main method.

10. Java operating mechanism

First, we have to understand the code we have written. The source file is a .java file, which cannot be run. It must be compiled into a .class file (also known as bytecode file, class file) through javac. Then the JVM (virtual machine) converts it into machine code recognized by the operating system and executes it.
Secondly, it should be noted that the Java command must be followed by the class name, without adding .class (when running in the command prompt window).
The running details of the code: First, Java will look for the corresponding .class file. Then find the corresponding public class (main class), and find the corresponding entry method (main method) in the main class. Then, start to execute the statements in the main method from top to bottom and from left to right. These statements end with an English semicolon, and the statements correspond to bytecode instructions, and then run through the JVM.

11. Naming rules

(1) Only letters, numbers, underscore _, dollar sign $, and numbers cannot start
(2) Keywords and reserved words cannot be used

12. Recommended text editing software

Sublime text 2 ,VIM ,notepad++ 等

Guess you like

Origin blog.csdn.net/MIRACLE_Ying/article/details/112010660