Java Learning Article 1 --- Java getting started, Article 1 --- java
This is my first blog. I will also write my own Java learning process, some knowledge points, and experiences to encourage myself to keep learning!
Now I started my learning Java career: [Personal download Jdk version is jdk-8u5-windows-x64]
1. directory after installation:
-> Source Code: Install this option to install the Source Code of all Java core class libraries.
-> Bin: This path stores various JDK tool commands, commonly used Javac, java, and other commands.
-> Db: This path is the path for installing Java DB [DB (data base, database) is a data set organized according to a certain data model and stored in Level 2 memory .]
-> Include: Platform-specific header files.
-> Jre: the JRE environment required to run the Java program is installed in this path.
-> Lib: This path stores the actual execution program of the JDK command. (It contains the following compiling and running requirements: dt. jar and tools. jar)
-> Javafx-src.zip: the compressed file stores the source code of all the core class libraries of Java FX.
-> Src.zip: the compressed file contains the source code of all Java core class libraries.
-> Descriptive documents such as README and LICENSE.
2. environment variable settings:
-> Path = D: \ Java \ jdk1.8.0 _ 05 \ bin (JDK installation location-> JDK tool location)
-> CLASSPATH: you do not need to set CLASSPATH separately in JDK 1.5 or later versions. Of course, if the setting is correct, you must note that adding (.) indicates the current directory.
[General settings: D: \ Java \ jdk1.8.0 _ 05 \ bin \ dt. jar;.; D: \ Java \ jdk1.8.0 _ 05 \ bin \ tools. jar]
3. Naming rules for Java source files and Case sensitivity issues
-> Class name. java. For the class name, if the public modifier is not used in the file, the name can be any name that complies with the rules, but if a public class is defined in the source file,
The class name must be the same as the defined class name. Only one public class can be defined in the source file.
-> Strictly case sensitive in Java: All Java keywords are in lower case and do not need to be capitalized.
-> Main: The compiled class. If you want to run it, the main must exist in it. The main method must be modified using public and static,
The return value of this method must be declared using void, and the parameter type can only be a string array, but not other parameters. In addition, the public and static positions can be exchanged,
Other locations are fixed.
-> Eg: public static void main (String [] args)
4. Java garbage collection mechanism
The memory allocation and recovery of Java programs are automatically performed by JRE in the background. JRE recycles memory spaces that are no longer in use. These memory spaces are the memory space in the JVM heap memory.
Garbage collection is a kind of dynamic storage management technology. It Automatically releases objects that are no longer referenced by programs, and carries out automatic collection of memory resources based on specific garbage collection algorithms.
Of course, garbage collection cannot be precisely controlled, which means it will be automatically executed when the cpu is idle or the memory is about to run out.
The current JVM has multiple garbage collection mechanisms.
I think it is important to write something because I have not read much! In addition, the knowledge points come from the crazy JAVA handout (version 3rd).