Introduction to the Java Language

Introduction to the Java Language

      Java is a general term for the Java programming language (hereinafter referred to as the Java language) and the Java platform launched by Sun Microsystems in May 1995. The HotJava browser (supporting Java applet) implemented in Java shows the charm of Java: cross-platform, dynamic Web, Internet computing. Since then, Java has been widely accepted and promoted the rapid development of the Web, and commonly used browsers now support Java applets. On the other hand, Java technology is also constantly updated.

  The Java platform consists of a Java Virtual Machine (Java Virtual Machine) and a Java Application Programming Interface (API for short). The Java application programming interface provides a standard interface independent of the operating system for Java applications, which can be divided into basic parts and extended parts. After installing a Java platform on the hardware or operating system platform, Java applications can run. The Java platform is now embedded in almost all operating systems. In this way, Java programs can be compiled only once and run on various systems. The Java Application Programming Interface has evolved from version 1.1x to version 1.2. Currently the commonly used Java platform is based on Java1.4, and the latest version is Java1.6.

  Java is divided into three systems: J2SE (Java2 Standard Edition), J2EE (Java 2 Platform, Enterprise Edition), and J2ME (Java 2 Micro Edition).

       J2SE, the standard version of Java

       J2EE, the enterprise version of Java, used in the development of large-scale enterprise applications

       J2ME, Java ME is mainly used for embedded development

 

       The Java language is an object-oriented programming language that supports network computing. Java language absorbs the advantages of Smalltalk language and C++ language, and adds other features, such as support for concurrent programming, network communication, and multimedia data control. The main features are as follows:

  1. The Java language is simple. The syntax of the Java language is very close to the C and C++ languages, making it easy for most programmers to learn and use Java. Java, on the other hand, discards the rarely used, hard-to-understand, and confusing features of C++, such as operator overloading, multiple inheritance, and automatic casts. In particular, the Java language does not use pointers, and provides automatic garbage collection, so that programmers do not have to worry about memory management.

  2, the Java language is an object-oriented. The Java language provides primitives such as classes, interfaces and inheritance. For the sake of simplicity, it only supports single inheritance between classes, but supports multiple inheritance between interfaces, and supports the implementation mechanism between classes and interfaces (the keyword is 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.

  3. 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 and so on. Java's RMI (Remote Method Activation) mechanism is also an important means of developing distributed applications.

  4. The Java language is robust. Java's strong type mechanism, exception handling, and automatic garbage collection are important guarantees for the robustness of Java programs. Discarding pointers is a sensible choice for Java. Java's security checking mechanism makes Java more robust.

  5. The Java language is safe. Java is usually used in the network environment, for this, Java provides a security mechanism to prevent malicious code attacks. In addition to many security features of the Java language, Java has a security precaution mechanism (class ClassLoader) for classes downloaded over the network, such as assigning different namespaces to prevent replacement of local classes of the same name, byte code checking, and providing security management The mechanism (class SecurityManager) lets Java applications set up security sentinels.

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

  7. The Java language is portable. This portability comes from architecture neutrality, in addition, Java also strictly stipulates 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 runtime environment is implemented in ANSI C.

  8. The Java language is interpreted. As mentioned earlier, Java programs are compiled into bytecode format on the Java platform, which can then be run on any system that implements this Java platform. At runtime, the Java interpreter in the Java platform interprets and executes these bytecodes, and the classes required in the execution process are loaded into the runtime environment in the linking phase.

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

 

    10. 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 sub (grandchild) class. There are usually two ways to create a thread: First, wrap an object that implements the Runnable interface into a thread using a constructor of type Thread(Runnable), and second, derive a subclass from the Thread class and override run method, an object created using this subclass is a thread. It is worth noting that the Thread class has implemented the Runnable interface, so any thread has its run method, and the run method contains the code to be run by the thread. A thread's activity 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 (the keyword is synchronized).

  11. 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 also facilitates software upgrades. In addition, classes in Java have a runtime representation that enables runtime type checking.

  The excellent features of the Java language make Java applications unparalleled robustness and reliability, which also reduces the maintenance costs of the application system. Java's comprehensive support for object technology and the API embedded in the Java platform can shorten application development time and reduce costs. The compile-once-run-anywhere nature of Java enables it to provide an open architecture that is available everywhere and a low-cost way of passing information between multiple platforms. In particular, the Java Enterprise Application Programming Interface (Java Enterprise APIs) provides relevant technologies and rich class libraries for enterprise computing and e-commerce application systems.

Guess you like

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