Java BASICS (I) Java language features

Source: Internet
Author: User

To learn about software development, you must first select the required programming language, consider the advantages and disadvantages of the language and actual needs, and then select the relevant language for system development after comprehensive evaluation. This blog begins with the popular Java in recent years.

Background in 1995, SUN released the first white paper of Java, which defines Java as: Java is a Simple, Object-Oriented (Object-Oriented ), distributed, Interpreted, Robust, Secure, Architecture-neutral, and Portable ), high-Performance, Multi-Threaded, and Dynamic language. How can we understand these features?

The simplicity of Java is relative to other languages. In terms of its own learning, it is actually not easy. Java is a C programming language. Its basic syntax is similar to C and C ++. Its simplicity is important to remove the error-prone pointers and memory management in C, but because of this, Java memory management is relatively difficult for development. It is often caused by the problem that memory overflow cannot be released. Another aspect of simplicity is that software written in Java can run on a very small machine, which is related to the small size of its own base class library less than 1 MB.

Object-Oriented Java is a fully object-oriented programming language. Although it only supports single inheritance between classes, it can implement multiple interfaces, in addition, the full support for dynamic binding in Java also facilitates us.

Distributed Java has a class library that supports HTTP, FTP, and other TCP/IP protocols. Therefore, Java can obtain any resources on the network and operate network resources as local resources, in addition, Remote Method Invocation (RMI) in Java also provides an important means for distributed implementation.

Interpreted Java is an interpreted programming language. Programs Written in Java are compiled into bytecode on the Java platform. At runtime, the interpreters on the Java platform interpret and execute these bytecode, which is different from compiled languages such as C and C ++.

The robustness of Java is mainly manifested in Java's management of pointers and memory. Despite the concept of removing pointers in Java, Java uses a clever method similar to pointer object reference to avoid the randomness of pointer usage. In terms of memory management, the automatic collection mechanism of Java memory is also an important guarantee for Java program robustness.

The security of Java is mainly manifested in two aspects: on the one hand, it is the characteristics of the language itself, for example, removing pointers to avoid direct operations on the memory; on the other hand, java itself provides a secure running mechanism to protect users from the destruction of untrusted programs, that is, the so-called sandbox mechanism. The role of sandbox is to ensure that Java programs can only run within the sandbox boundary. In other words, Java programs can run freely within the sandbox boundary, but nothing can be done beyond the sandbox boundary.

Structure-neutral Java language structure-neutral is because Java programs are designed to run on Java virtual machines between source programs and specific machines. The main reason is that the bytecode file generated by the compilation is only related to the Java Virtual Machine and has nothing to do with the specific machine. This is why such bytecode can be executed on many processors.

The portability of Java is based on the neutral structure of Java. In addition, Java has strict rules on the size and algorithm of basic data types, so its portability is relatively good.

High-performance Java is relatively high-performance. Generally, compiled languages are more efficient than interpreted languages. Compared with other explanatory languages, Java itself is very efficient. Although Java itself is slightly less efficient than interpreted C and C ++, with the development of Java compilers, this gap is gradually becoming smaller.

The multi-threaded Java language supports simultaneous execution of multiple threads and provides a mechanism for Synchronous execution between multiple threads. That is to say, Java has good real-time interaction and real-time control.

The dynamic nature of dynamic Java is manifested in the ability of classes required by Java programs to be dynamically loaded into the runtime environment, which is of great significance for software upgrade and maintenance.

Today, we will mainly explain the 11 features of Java. If you only need to deal with development, you should have a simple understanding. However, you need to have a deeper understanding of the architecture design or system level, this is why we need to learn more about the Java language.

Well, today we will introduce it here. Next time we will continue to introduce other Java-related content.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.