Java language and cross-platform principle

About Java


insert image description here

Java is an object-oriented programming language. It not only absorbs various advantages of C++ language, but also abandons the incomprehensible concepts of multiple inheritance and pointers in C++. Therefore, Java language has two characteristics of powerful functions and simplicity and ease of use. As a representative of static object-oriented programming language, Java language perfectly implements object-oriented theory, allowing programmers to perform complex programming in an elegant way of thinking.
Java has the characteristics of simplicity, object orientation, distribution, robustness, security, platform independence and portability, multithreading, and dynamism. Java can write desktop applications, web applications, distributed systems and embedded system applications, etc.

Technology application

  1. Android Applications
    Many Android applications are developed by Java programmers. Although Android uses a different JVM and different packaging methods, the code is still written in the Java language. A considerable part of mobile phones support JAVA games, which makes many non-programmers know JAVA.
  2. The server program
    Java used in the financial industry is widely used in the financial service industry. Many third-party transaction systems, banks, and financial institutions choose to develop in Java, because Java is relatively safe. Large multinational investment banks use Java to program front- and back-office electronic transaction systems, settlement and confirmation systems, data processing projects, and other projects. In most cases, Java is used for server-side development, but most do not have any front-end, they usually receive data from a server (upper level), process it and send it to another processing system (lower level processing).
  3. Website
    Java occupies a certain seat in the field of e-commerce and website development. Developers can use many different frameworks to create web projects, SpringMVC, Struts2.0 and frameworks. Even simple servlets, jsp and struts-based websites are often used in government projects. Websites of different departments such as medical care, insurance, education, defense, and others are all developed on the basis of Java.
  4. Embedded field
    Java has a lot of room for development in the embedded field. On this platform, Java technology (on a smart card or sensor) can be used with only 130KB.
  5. Big data technology
    Hadoop and many other big data processing technologies use Java, such as Apache's Java-based HBase and Accumulo and ElasticSearchas.
  6. The space
    Java platform for high-frequency trading enhances the features of this platform and even if compiled, it can also pass data like C++. It is for this reason that Java has become the language of choice for programmers to write trading platforms, because while performance is not as good as C++, developers can sidestep issues such as security, portability, and maintainability.
  7. Scientific Applications
    Java is a good choice for scientific applications, including natural language processing. The main reason is because Java is better than C++ or other languages ​​for its security, portability, maintainability, and concurrency of other high-level languages.

Cross-Platform Principle

Platform is Value Operating System
Java Virtual Machine

JVM is the abbreviation of Java Virtual Machine (Java Virtual Machine). JVM is a specification for computing devices. It is a fictional computer that is realized by simulating various computer functions on an actual computer.
After the introduction of the Java language virtual machine, the Java language does not need to be recompiled when running on different platforms. The Java language uses the Java virtual machine to shield the information related to the specific platform, so that the Java language compiler only needs to generate the object code (bytecode) running on the Java virtual machine, and it can run on various platforms without modification. .

The Java virtual machine has its own complete hardware architecture, such as processor, stack, etc., and also has a corresponding instruction system.

A Java virtual machine is essentially a program that, when started on the command line, starts executing instructions stored in a bytecode file. The portability of the Java language is based on the Java Virtual Machine. Bytecode files (.class) can run on any platform as long as a Java virtual machine for that platform is installed. This is "compile once, run many".
Java virtual machine is not only a cross-platform software, but also a new network computing platform. The platform includes many related technologies, such as various APIs that conform to open interface standards, optimization technologies, etc. Java technology enables the same application to run on different platforms. The Java platform can be divided into two parts, namely the Java virtual machine (Java virtual machine, JVM) and the Java API class library.


The storage space required to reclaim an instance of a Java class by fragmentation is allocated on the heap. The interpreter is specifically responsible for allocating space for class instances. After the interpreter allocates storage space for an instance, it starts recording the usage of the memory area occupied by the instance. Once the object is used up, it is recycled to the heap. In the Java language, there is no other way to allocate and free memory for an object other than the new statement. The work of freeing and reclaiming memory is undertaken by the Java runtime system. This allows the designers of the Java runtime system to decide on their own method of garbage collection. In the Java interpreter and the Hot Java environment developed by SUN, fragment recovery is performed by way of background threads. This not only provides good performance for the running system, but also frees the programmer from the risk of controlling memory usage by himself.


Guess you like

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