Features of Jane v. Java (reproduced)

Source: Internet
Author: User

Java is an object-oriented programming language, not only absorbs the various advantages of the C + + language, but also adheres to the more difficult to understand in C + + inheritance, pointers and other concepts, so the Java language it with powerful and easy to use two features. As the representative of static object-oriented programming language, the Java language implements the object-oriented theory very well, and the programmer can carry on the complicated programming with the graceful way of thinking.

Java contains simplicity, object-oriented, distributed, robust, security, platform independence and portability, multi-threading, dynamic and so on. Java can write desktop applications, Web applications, distributed systems, and embedded system applications.


So for our Java, it's different from other programming languages as a programming language! Let's take a look at it!

1. Simplicity

Java seems to be designed to look like C + +, but in order to make the language small and easy to understand, designers have removed many of the features available in the C + + language, which are rarely used by programmers. For example, Java does not support go to statements and instead provides break and continue statements and exception handling. Java also rejects the C + + operator overload (overload) and multiple inheritance features, and does not use the master file, eliminating the preprocessor. Because Java has no structure, arrays and strings are objects, so pointers are not required. Java can automatically handle object references and indirect references, enabling automatic garbage collection of cells, so that users do not have to worry about storage management issues, more time and effort to spend on research and development.

2. Object-oriented

Java is an object-oriented language. For programmers, this means paying attention to the data that should be in place and manipulating the data (method), rather than strictly using the process to think. In an object-oriented system, a class is a collection of methods for data and manipulating data. Data and methods together describe the state and behavior of an object. Each object is an encapsulation of its state and behavior. Classes are arranged according to a certain system and hierarchy, allowing subclasses to inherit behavior from the superclass. In this class hierarchy there is a root class, which is a class with general behavior. Java programs are organized using classes.

Java also includes an extended collection of classes, each consisting of packages, that users can use in their own programs. For example, Java provides classes that produce graphical user interface parts (java.awt packages), where AWT is an abbreviation for the abstract window toolset (Abstract Windowing Toolkit), the classes that handle input and output (java.io packages), and classes that support network functionality ( java.net package).

3. Distribution

Java is designed to support applications on the web, and it is a distributed language. Java supports a variety of levels of network connectivity, and the socket class supports a reliable stream network connection, so users can generate distributed clients and servers.

The network becomes a distributed vehicle for software applications. Java programs can be run everywhere once they are written.

4. Compilation and interpretation

The Java compiler generates bytecode (Byte-code) instead of the usual machine code. Java bytecode provides an architecture-neutral destination file format that is designed to efficiently transfer programs to multiple platforms. Java programs can run on any system that implements the Java interpreter and the running system (Run-time systems).

In an interpretive environment, the standard "link" phase of program development is greatly diminished. If Java has a link stage, it is simply the process of loading the new class into the environment, which is an incremental, lightweight process. As a result, Java supports rapid prototyping and easy experimentation, which leads to rapid program development. This is a sophisticated development process that contrasts with traditional, time-consuming "compilation, linking, and testing".

5. Robustness

Java was originally used as a language for writing consumer home electronics software, so it was designed to write highly reliable and robust software. Java eliminates some programming errors, making it fairly easy to write reliable software with it.

Java is a strongly typed language that allows you to extend the ability to check for potential type mismatch problems at compile time. Java requires an explicit method declaration, which does not support the C-style implicit declaration. These stringent requirements ensure that the compiler can catch call errors, which leads to more reliable programs.

One of the most important enhancements to reliability is the Java storage model. Java does not support pointers, and it eliminates the possibility of rewriting stored and corruption data. Similarly, Java's automated "garbage collection" prevents storage leaks and other harmful errors related to dynamic storage allocation and deallocation. The Java interpreter also performs many run-time checks, such as verifying that all arrays and string accesses are within bounds.

Exception handling is another feature in Java that makes the program more robust. An exception is a signal that occurs with an abnormal condition that resembles an error. Using the try/catch/finally statement, the programmer can find the processing code of the error, which simplifies the task of error handling and recovery.

6. Security

The storage allocation model for Java is one of the main ways it defends against malicious code. Java has no pointers, so programmers can't get the hidden insider and forge pointers to the memory. More importantly, the Java compiler does not handle storage scheduling decisions, so programmers cannot guess the actual storage schedule of classes by looking at the claims. Stored references in compiled Java code are at runtime determined by the Java interpreter to actually store the address.

The Java runtime uses the bytecode verification process to ensure that code that is mounted on the network does not violate any Java language restrictions. This security mechanism section includes how classes are loaded from the Web. For example, a loaded class is placed in a separate namespace instead of a local class, preventing a malicious small application from using its own version instead of the standard Java class.

7. Portability

Java makes language declarations independent of the implementation aspect. For example, Java explicitly describes the size of each base data type and its operational behavior (these data types are described by Java syntax).

The Java environment itself is portable for new hardware platforms and operating systems. The Java compiler is also written in Java, while the Java runtime system is written in Ansic language.

8. High Performance

Java is a language that is compiled and interpreted first, so it is not as fast as a fully compiled language. However, in some cases performance is very important, in order to support these situations, the Java designer to create a "timely" compiler, it can at runtime to translate Java bytecode into a specific CPU (central processing Unit) machine code, that is, the implementation of full compilation.

The Java bytecode format design takes into account the need for these "just-in-time" compilers, so the process of generating machine code is fairly straightforward, and it can produce pretty good code.

9. Multi-line

Java is a multi-threaded language that provides support for multi-threaded execution (also known as a lightweight process) and can handle different tasks, making it easy to program with clues. The Java lang Packet provides a thread class that supports methods for starting clues, running clues, stopping clues, and checking the status of clues.

Java's lead support also includes a set of synchronization primitives. These primitives are based on supervised procedures and conditional variable demeanor, developed by C.a.r.haore for a widely used synchronization scheme. With the keyword synchronized, programmers can demonstrate that some methods cannot run concurrently in a class. These methods are controlled by the supervisory program to ensure that the variables are maintained in a consistent state.

10. Dynamic Nature

The Java language is designed to adapt to a changing environment and it is a dynamic language. For example, classes in Java are loaded as needed, and even some are obtained over the network.

Transferred from: http://www.itxdl.cn/

Features of Jane v. Java (reproduced)

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.