Hackerthink logo


Java Introduction

Java is the general term for Java object-oriented programming language and Java platform launched by Sun Microsystems in May 1995. It was jointly developed by James Gosling and his colleagues and officially launched in 1995.

Later, Sun was acquired by Oracle (Oracle), and Java became a product of Oracle.

Java is divided into three systems:

  • JavaSE (J2SE) (Java2 Platform Standard Edition, java platform standard edition)
  • JavaEE (J2EE) (Java 2 Platform, Enterprise Edition, Java Platform Enterprise Edition)
  • JavaME (J2ME) (Java 2 Platform Micro Edition, Java Platform Micro Edition).

In June 2005, the JavaOne conference was held, and Sun Company announced Java SE 6. At this time, the various versions of Java have been renamed to cancel the number “2”: J2EE was renamed Java EE, J2SE was renamed Java SE, and J2ME was renamed Java ME.

Main features

  • The Java language is simple:

    The grammar of the Java language is very close to the C language and C++ language, making it easy for most programmers to learn and use. On the other hand, Java discards those features that are rarely used, difficult to understand, and confusing in C++, such as operator overloading, multiple inheritance, and automatic type conversion. In particular, the Java language does not use pointers, but references. And provides automatic allocation and recovery of memory space, so that programmers do not have to worry about memory management.

  • The Java language is object-oriented:

    The Java language provides object-oriented features such as classes, interfaces, and inheritance. For simplicity, it only supports single inheritance between classes, but supports multiple inheritance between interfaces, and supports the implementation mechanism between classes and interfaces (keywords are implements). The Java language fully supports dynamic binding, while the C++ language only uses dynamic binding for virtual functions. In short, the Java language is a pure object-oriented programming language.

  • The Java language is distributed:

    The Java language supports the development of Internet applications. There is a network application programming interface (java net) in the basic Java application programming interface, which provides a class library for network application programming, including URL, URLConnection, Socket, ServerSocket, etc. Java’s RMI (Remote Method Activation) mechanism is also an important means of developing distributed applications.

  • The Java language is robust:

    Java’s strong typing mechanism, exception handling, and automatic garbage collection are important guarantees for the robustness of Java programs. The discarding of pointers is a wise choice for Java. Java’s security check mechanism makes Java more robust.

  • The Java language is safe:

    Java is usually used in the network environment. For this reason, Java provides a security mechanism to prevent malicious code attacks. In addition to many security features of the Java language, Java has a security protection mechanism (ClassLoader) for classes downloaded through the network, such as allocating different namespaces to prevent substitution of local classes with the same name, byte code checking, and providing security management The mechanism (class SecurityManager) allows Java applications to set up security guards.

  • The Java language is architecture neutral:

    Java programs (files with a suffix of java) are compiled into an architecture-neutral bytecode format (files with a suffix of class) on the Java platform, and then can be run in any system that implements the Java platform. This approach is suitable for heterogeneous network environments and software distribution.

  • The Java language is portable:

    This portability comes from the neutrality of the architecture, in addition, Java also strictly regulates the length of each basic data type. The Java system itself also has strong portability. The Java compiler is implemented in Java, and the Java operating environment is implemented in ANSI C.

  • The Java language is interpreted:

    As mentioned earlier, Java programs are compiled into bytecode format on the Java platform, and then can be run in any system that implements the Java platform. At runtime, the Java interpreter in the Java platform interprets and executes these bytecodes, and the classes needed in the execution process are loaded into the runtime environment during the connection phase.

  • Java is high-performance:

    Compared with those interpreted high-level scripting languages, Java is indeed high-performance. In fact, the running speed of Java is getting closer and closer to C++ with the development of JIT (Just-In-Time) compiler technology.

  • The Java language is multithreaded:

    In the Java language, a thread is a special object that must be created by the Thread class or its descendants (grandchildren). There are usually two ways to create a thread: one is to wrap an object that implements the Runnable interface into a thread using a constructor subclass of type Thread(Runnable); the other is to derive a subclass from the Thread class and override it In the run method, the object created by this subclass is the thread. It is worth noting that the Thread class has implemented the Runnable interface, therefore, any thread has its run method, and the run method contains the code to be run by the thread. The activity of the thread is controlled by a set of methods. The Java language supports the simultaneous execution of multiple threads and provides a synchronization mechanism between multiple threads (keyword is synchronized).

  • The Java language is dynamic:

    One of the design goals of the Java language is to adapt to a dynamically changing environment. The classes required by the Java program can be dynamically loaded into the runtime environment, and the required classes can also be loaded through the network. This is also conducive to software upgrades. In addition, classes in Java have a runtime representation that can perform runtime type checking.

Development History

  • On May 23, 1995, the Java language was born
  • In January 1996, the first JDK-JDK1.0 was born
  • In April 1996, 10 major operating system vendors declared that they would embed JAVA technology in their products
  • In September 1996, approximately 83,000 web pages were produced using JAVA technology
  • On February 18, 1997, JDK1.1 was released
  • On April 2, 1997, the JavaOne conference was held with more than 10,000 participants, setting a record for the scale of similar conferences in the world at that time
  • In September 1997, the JavaDeveloperConnection community had more than 100,000 members
  • In February 1998, JDK1.1 was downloaded more than 2,000,000 times
  • On December 8, 1998, JAVA2 Enterprise Platform J2EE was released
  • In June 1999, Sun released three versions of Java: Standard Edition (JavaSE, formerly J2SE), Enterprise Edition (JavaEE formerly J2EE) and Micro Edition (JavaME, formerly J2ME)
  • JDK1.3 was released on May 8, 2000
  • On May 29, 2000, JDK1.4 was released
  • On June 5, 2001, NOKIA announced that it would sell 100 million Java-enabled mobile phones by 2003
  • On September 24, 2001, J2EE1.3 was released
  • On February 26, 2002, J2SE1.4 was released. Since then, the computing power of Java has been greatly improved
  • At 18:00 PM on September 30, 2004, J2SE1.5 was released, becoming another milestone in the history of Java language development. To express the importance of this version, J2SE1.5 was renamed Java SE 5.0
  • In June 2005, the JavaOne conference was held, and Sun Company announced Java SE 6. At this time, the various versions of Java have been renamed to cancel the number “2”: J2EE was renamed Java EE, J2SE was renamed Java SE, and J2ME was renamed Java ME
  • In December 2006, Sun released JRE6.0
  • On April 20, 2009, Oracle acquired Sun for US$7.4 billion and obtained the copyright of Java.
  • In November 2010, due to Oracle’s unkindness to the Java community, Apache threatened to withdraw from the JCP.
  • On July 28, 2011, Oracle released the official version of Java7.0.
  • On March 18, 2014, Oracle Corporation announced Java SE 8.
  • On September 21, 2017, Oracle Corporation announced Java SE 9
  • On March 21, 2018, Oracle Corporation announced Java SE 10
  • On September 25, 2018, Java SE 11 was released
  • On March 20, 2019, Java SE 12 was released

Java development tools

The Java language tries to ensure that the system memory is above 1G, and other tools are as follows:

After installing the above tools, we can output the first Java program “Hello World!”

public class HelloWorld { 
  public static void main ( String [ ] args ) { 
    System . out . println ( " Hello World " ) ;

In the next chapter we will introduce how to configure the java development environment.