Why should I choose Java when there are so many languages like C and Python
The reason is that the Java language provides more jobs than any other language. The question then becomes why Java is more popular. ** extracts several Java keywords for reference.
Java is estimated to be running on more than 3 billion devices worldwide, more than any other language. Java is used on many of the world’s most popular web sites, including eBay.com, Linkedin.com, Amazon.com, and Facebook.com. This should be the deep reason why Java is still standing, everyone is using it, is really strong. Easy to learn Java itself inheritance in C++ language object-oriented core technology, abandoned easy to cause error Pointers, operator overload, multiple inheritance and other difficult to understand the concept. The addition of garbage collection mechanism greatly simplifies the development cost of programmers. Cross-platform one place compilation running anywhere on any platform as long as the JVM is installed, you can run Java programs. There are about 9 million Java developers worldwide, creating a vibrant and aggressive Java community with a rich open source class library.
To sum up, the cost of learning is low (the language is easier to get started than C), Java development is increasing, a vibrant community is formed, open source libraries are becoming richer, and the JVM itself is widely used.
1. Introduction of Java tools (JVM, JDK, JRE)
JVM(Java Virtual Machine)
Features “Compile once run everywhere”
Scenario I need to run Java programs on two PCS, one in Windows and the other in Linux. I only need to install Java and add another Layer of Java VIRTUAL machines (VMS) on the operating system based on JDK (JVMS) provided by different operating systems. The Java VMS are responsible for code compilation and running.
The JVM compiles and runs
.java source code — Java bytecode that the JVM can understand — binary machine code that the machine can execute
extensionThere are methods and blocks of code that often need to be referenced by calls (hot code) in business scenariosThe JIT compiler ** (runtime compilation) saves the machine code corresponding to the bytecode after the first compilation for later use.
JRE(Java Runtime Environment)
It contains a collection of all the tools that run compiled Java programs, including the Java Virtual Machine (JVM), Java class libraries, Java commands, and other basic artifacts. However, it cannot be used to create new programs.
JDK(Java development tools)
A full-featured Java SDK. It has everything the JRE has, as well as a compiler (Javac) and tools (javadoc, JDB). Ability to create and compile programs.
Java language – compiled and interpreted language
High-level programming languages are divided into compiled and interpreted languages according to the way programs are executed. explain
Scenario: Reading a famous Book in English Solution: 1- find a translator to translate the whole famous book (source) into Chinese, and then read – compiled language 2- let the translator translate a paragraph, you read a paragraph – explained language analogy: Java first compiles.java files to bytecode.class, which is interpreted and executed by the Java interpreter
So we think of the Java language as both compiled and interpreted.