Began to learn Java again, this is also for the future job consideration. Simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple simple I found migraine Yang’s introduction to Java series on CSDN, very well written!

1. Understanding Java in migraine Young’s Introduction to Java teaching series

Here is a link to the first article by Migraine Young, in which the author assigned 10 questions at the beginning of the second article in the series. Below are my answers (mostly excerpts from the author’s article).

1. Why can Java be cross-platform?

Cross-platform means across different operating systems, because from writing Java code to running it, there are two processes: the source code of a Java program (.java) is compiled into bytecode (.class) that the VIRTUAL machine (JVM) can understand, and then the virtual machine interprets and executes it into machine code that the corresponding operating system can understand. This enables the so-called cross-platform, Write Once, Run Anywhere compilation. It is important to note that there are JVMS running on different operating systems, but this does not conflict with cross-platform because even though some of the details of the VMS on different operating systems are different, they all understand the same bytecodes (.class), and bytecodes are platform-independent.

2. Which programming language did Java copy?

C++

3. Which company invented Java?

Sun

4. Who is Java’s father?

James Gosling

5. How does Java work?

The Java program’s source code (.java) is compiled into bytecode (.class) that the VIRTUAL machine (JVM) can understand, which is then interpreted and executed by the virtual machine into machine code that the corresponding operating system can understand

6. What are JDK&JRE&JVM and their relationship?

JVM(Java Virtual Machine):

Java virtual machine, mainly responsible for running Java compiler compiled bytecode files (*.class files), it exists in memory, dealing with memory. The JVM runs on top of the operating system and has no direct interaction with the hardware, making it the core of cross-platform implementation. The JVM is an abstract virtual computer that has an instruction set and uses different storage areas just like a real computer. It is responsible for executing instructions and managing data, memory and registers, instruction sets, registers, class file formats, stacks, garbage collection heaps, storage areas, and so on. When the JVM executes bytecode, it interprets the bytecode as machine code execution on a specific platform. It cannot be executed by the JVM itself and must be used in conjunction with the Java Base & Core libraries in the JRE.

JRE(Java Runtime Environment):

Java Runtime Environment, a standard environment that supports the running of Java programs, including the standard implementation of the JVM (Java Virtual Machine) and the Java foundation & core class libraries.

The jre1.8 directory contains:

  • Bin: If you have java.exe but do not have javac.exe, you cannot compile Java programs. However, you can run Java programs.
  • Lib: Java base & core libraries, such as rt.jar, also contain libraries required by the JVM runtime.

JRE=JVM+Java Base & Core Libraries

JDK(Java Development Kit):

Java Development Kit, is a development environment for writing Java applications (programmers only). JDK is the core of Java, including JRE (Java runtime environment) and some Java development tools (such as JConsole, Javac, Java, Javadoc, Native2ASCII, JAR, etc.). The mainstream JDK is the JDK released by Sun Company. In addition to Sun Company, many other companies and organizations have developed their own JDK, such as THE JDK developed by IBM Company, THE JDK by BEA Company, and the JDK developed by GNU organization.

The jdk1.8 directory contains:

  • Bin: a collection of exe files, including javac, such as JConsole, Javac, Java, Javadoc, and Native2ASCII.
  • Jre: Java runtime environment, including JVM+Java base & Core libraries.
  • Lib: contains dt.jar+tools.jar common library, development dependency package.
  • Db: The Derby database, which has been built into the JDK since 1.6, is an in-memory database implemented purely in Java and is an open source project of Apache. Implemented in Java, so it can run on any platform; Another feature is small size, no installation, only a few small JAR packages can be run.
  • Include: header file used for Java and JVM interaction.

JDK=JRE+Java development tools (compiler, debugger, etc.)

Conclusion: JDK&JRE & JVM

The JRE is a runtime environment, and the JDK is a development environment, so you need the JDK to write Java programs, and you need the JRE to run Java programs. The JDK already includes the JRE, so Java programs can be developed and run properly as long as the JDK is installed. However, JDK contains a lot of non-runtime content, such as compiler, debugger, etc., which takes up a lot of space. Therefore, you do not need to install JDK to run ordinary Java programs, but only need to install JRE (for example, to run Java programs on the server).

7. Application scenarios of Java?

Server applications for Internet applications (including distributed systems)

Many third-party trading systems, banks, financial institutions, large websites and Internet platforms all choose Java development. Most of the time, Java is used for server-side development, but most of the time without any front end, they typically receive data from one server, process it and send it to another processing system.

The Android

Many Android applications are developed by Java programmers and developers. Although Android uses different JVMS and different encapsulation methods, the code is still written in the Java language. JAVA games are supported on a significant number of mobile phones, which makes JAVA accessible to many non-programmers.

Big data technology

Hadoop and other big data processing technologies are mostly Java, such as Apache’s Java-based HBase and Accumulo and ElasticSearchas.

Web site

Java has taken its place in e-commerce as well as web development. There are many different frameworks developers can use to create web projects, such as SpringMVC, Struts2.0, and frameworks. Even simple servlets, JSPS, and Struts-based websites are often used in government projects. Health care, insurance, education, defense, and other diverse sector websites are all based on Java.

Embedded domain

Java has a lot of room to grow in the embedded space. On this platform, only 130KB is required to use Java technology (on smart cards or sensors).

A desktop application

Examples: JMeter, NetBeans, Freemind, Eclipse, etc.

The game

Minecraft, the worldwide hit, and a bunch of Java mini-games.

8. What are the functions of Java and javac commands?

The javac command is in the JDK bin folder and is used to compile Java source programs (.java) into virtual-aware bytecode (.class).

Java commands are stored in the bin folder of the JRE and are used to interpret the bytecode (.class) of the VM into machine code that can be understood by the operating system of the corresponding platform.

9. How to configure the Java environment?

This ellipsis, go to see the author (migraine Yang) article, or Baidu can OK!

10. Some features of Java?

  • cross-platform
  • Important network programming language
  • Absorb the advantages of C++, abandon the concept of multiple inheritance, Pointers
  • Not only a language, but also a huge technical system (including programming language, virtual machine, development environment, application environment, deployment environment, etc.)