java language overview and development environment

1. A brief history of the development of the java language

*In late 1990 , Sun established a "Project Green" led by James Gosling to write a general control system for next-generation intelligence.
*In the summer of 1992, Project Green had completed some of the functions of the new platform, including Green Operating system, Oak's programming language, class library, etc.
*In the summer of 1994, the emergence of the Internet and browsers not only brought good news to the vast number of Internet users, but also brought new vitality to the Oak language. Oak was renamed java
*Sun company released JDK1.1 on February 18, 1997, JDK1.1 added JIT compiler
*In early 1996 Sun company released JAK1.0, this version includes 2 parts: runtime environment (JRE) and development Environment (JDK)
*In December 1998, Sun released the most important JDK version in java history: JDK1.2, and divided java into three versions: J2EE, J2SE and J2ME.
*In February 2002, Sun released the most mature version in JDK history: JDK1.4
*In October 2004, Sun released JDK1.5, and at the same time, Sun renamed JDK1.5 to javaSE5.0, and J2EE and J2ME also corresponded Changed to javaEE and javaME
*In December 2006, Sun released JDK1.6
*In 2009, Oracle acquired Sun

2.java program running mechanism

* Computer high-level languages ​​can be divided into compiled and interpreted according to the execution mode of the program

    a. Compiled language refers to the use of a special compiler to "translate" a high-level language source code for a specific platform (operating system) into machine code (including machine instructions and operands) that can be executed by the hardware of the platform. , and package it into the executable program format recognized by the platform. This conversion process is called compilation.

    b. Interpreted language refers to a language that uses a special interpreter to interpret the source program line by line into machine code of a specific platform and execute it immediately

*The running mechanism of java program and JVM
    Programs written in a.java language need to go through a compilation step, but this step does not generate platform-specific machine code, but generates a platform-independent bytecode (that is, a *.class file). The code is not executable and must be interpreted and executed by the java interpreter. Therefore: the java language is both a compiled language and an interpreted language. The execution process of a java program must go through two steps of compilation and interpretation
    . b. The Java virtual machine, or JVM, is responsible for interpreting and executing bytecode files. JVM is a virtual computer that can run java bytecode files
    c. When a java program is compiled with a java compiler, it generates platform-independent bytecodes, which are not oriented to any specific platform, only JVM

    d. JVM is an abstract computer, like a real computer, it has an instruction set and uses different storage areas, it is responsible for executing instructions, and also manages data, memory, and registers.

3. Preparation for developing java

    *https://jingyan.baidu.com/article/d7130635194f1513fcf47557.html Follow this program of Baidu to install

   

4. The first java program 

*public class HelloWorld{

    //Entry method of java program

    //public means public class means a class static means static void means empty main method name

    //String [] args is a list of formal parameters of the main method

    public static void main(String [] args) //Define a public static main method, which is the execution entry of a program

{

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

The difference between *public class and class

    a. Multiple classes can be defined in a java source file

    b. The public class in a java source file is not required

    c. A class will be defined to generate a xxx.class bytecode file

    d. If there is a public class in a java source file, there can only be one public class, and the public class name must be consistent with the name of the java source file

    e. The main method can be written in each class, and the entry of the program can be set.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324603776&siteId=291194637