JAVA first acquaintance (environmental configuration and basic operation mechanism)

Java Brief (personal opinion)

1. First of all, Java is a great computer language, and it is also an excellent enterprise-level computer language. Go language alongside with it (originally I had to learn it as a post-00 language (no virtual machine real coding) but Taking into account the future university academic courses, so learn Java first) can also be said to be a compiled language.
2. The use of Java is as extensive as that of python (I will make it seamlessly connected by then).
3. Perfect support for multi-concurrency mechanism, can become an excellent all-rounder, multi-threaded double opening. At the same time, this is also a relatively weak link of python (that is, all pythons burn memory computing resources).
4. With excellent migration and cross-platform, you can write code at one time and use it on multiple platforms without modification. Code written on Windows is directly transplanted on Linux.
5. Excellent garbage collection mechanism (GC) to solve the problem of c++ fainting (previously, I have some understanding of C language in the third year of junior high school summer vacation, I first learned C and finally chose python)

Three major components of java

It doesn't matter what the JDK is in the whole process. When it is important, this thing is a Java toolbox with many things that can be used.
JER is the operating environment of Java.
JVM Java's virtual machine is also the reason why Java is highly cross-platform.
Introduce the mechanism of the three
major pieces 1. JDK and JER have independent installation packages, but JVM does not.
2. Different platforms use different JVMs (virtual machines).
3. Download only need to download JDK contains a set of tools
4. If you only need to run the Jav program, then you only need to download the JER (operating environment)
Insert picture description here
relationship is about that, so it was at the beginning.
As for downloading, the one I just learned here is JDK13. This Java is from Oracle. You can go to the official website to download it, but for some reason I can’t get in. It is recommended to go to the script house to download
Insert picture description here
Insert picture description here

Three major versions of java

1. JSE means that the standard version is generally used for users to learn the JAVA language and is also the basis for using the other two versions. It is mainly used for writing C/S projects and providing standard JAVA class libraries. It is the basis for all development based on the Java language. Mainly used to develop desktop applications.
2. JEE refers to the enterprise version that relies on Internet technology to provide enterprise-level platform applications. To put it bluntly, it is used to build large-scale websites and B/S systems. As an enterprise version, it mainly provides a solution for developing enterprise-level application architecture. In this architecture, the relevant components are available for developers to use, such as JDBC used to connect to the database.
3. JME refers to the mobile version to build a platform for small mobile devices. It is mainly used to program mobile phones. Three versions of mobile phone related software are produced. One is for C/S projects such as QQ, one is for websites such as 163, and the other is for mobile phone systems such as Most mobile phone games are developed for mobile devices and embedded systems.

The operation of Java

1. The first code is the source code. Java file
2. Encode as bytecode. The class file
3. The class loader reads the class file to the virtual machine
. 4. The virtual machine works.
Steps 3 and 4 don't need humans to do, we only need to do steps 1, 2.

Insert picture description here

Why is cross-platform powerful?

A Java code written on Windows can be used directly on Linux or on Mac.
Of course, you can also code the class file.
The reasons are as follows;
see diagram
Insert picture description here

Java adds system environment.

1. Download jdk and install.
2. Configure the system environment.
(The installation will not demonstrate, the following is the environment to add window10)
Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here

Insert picture description here
verification
Insert picture description here

The first Java program

public class HelloWorld{
    
    
	public static void main(String[] args) {
    
    

		System.out.println("Hello World!");
	}
}

1. Use Javac to encode clss bytecode. (Enter the path of the source code file first)
javac file path\helloword.java (get helloworld.class)
2. Use Java to obtain
the name of the resulting java class through a series of internal operations (Java helloworld)

Insert picture description here
Insert picture description here
In terms of Java, I’m still a novice, give me a lot of advice (dog head protection)

Guess you like

Origin blog.csdn.net/FUTEROX/article/details/107498267