What are the common languages of Java? without introducing Java idioms, the overall introduction to Java is incomplete. While the source power of Java's birth is portability and security, other factors also play an important role in the final process of Java language formation. Next, green tea small make up Yi Yilai introduce.
· Simplicity (Simple)
· Security (Secure)
· Portable (Portable)
· Object Oriented (object-oriented)
· Robust (robust)
· Multithreading (multithreaded)
· Architecture Neutrality (architecture-neutral)
· Interpretation Execution (interpreted)
· High-performance (High performance)
· Distributed (distributed)
· Dynamics (Dynamic)
In these features, security and portability have been introduced in a number of articles, this article is mainly for the meaning of other features explained.
One, simple
Java design is designed to make professional programmers feel both easy to learn and useful. Assuming you have programming experience, you will not find Java difficult to master. If you already understand the basic concepts of object-oriented programming, it will be easier to learn java. If you are an experienced C + + programmer, it is best that learning Java is effortless.
Because of the Java-C + + syntax and many C + + object-oriented features, most programmers do not find it too difficult to learn java. In addition, many confusing concepts in C + + are either discarded by Java or implemented in a clearer, more understandable way.
In addition to similar to C + +, Java has another attribute that makes it easier to learn: designers try to make it look amazing in Java. In Java, it's very rare to tell you exactly how to accomplish a specific task.
Second, the object-oriented
Although influenced by its predecessors, Java is not designed to be a program compatible with other language source code. This allows the Java Development Group to freely start from scratch. As a result of this, the Java language can be more direct, more accessible, and more physically close to the object.
By referring to the advantages of object-oriented software in recent decades, Java tries to strike a balance between pure evolutionists ' "Everything is an object" and the pragmatist's argument that "no object is not discussed". Java's object model is simple and extensible, and it retains high performance for simple data types, such as integers, but not objects.
Third, strong
A multi-platform environment on the World Wide Web makes it particularly demanding for programs, because programs must be reliably executed on many systems. In this way, when Java is designed, robust programs are placed in a high priority position.
To gain reliability, Java restricts you in some key places, forcing you to discover errors early in the process of development. At the same time, Java lets you not worry about many of the most common problems that cause programming errors. Because Java is a strict type language, it examines code not only at compile time, but also at run time. In fact, many of the bugs that are difficult to reproduce and that are difficult to track at run time are almost impossible to produce in Java.
You know, it's a key feature of Java to make a program run in a predictable way in a different running environment.
To better understand how Java is robust, let's consider the two main reasons why programs fail: Memory management errors and error-causing exceptions (that is, run-time errors). In the traditional programming environment, memory management is a difficult and tedious task.
For example, in C + +, programmers must manually allocate and release all of the dynamic memory. This can sometimes cause problems because programmers may forget to release the memory they originally allocated, or to release memory that other parts of the program are using. Java can fundamentally eliminate these problems by managing memory allocations and releases for you (in fact, freeing up memory is completely automatic because Java provides automatic memory garbage collection for idle objects).
In a traditional environment, anomalies can often be caused by "0" or "File not found," and we must manage them with a large stack of instructions that are too numerous to understand. Java solves this problem by providing an object-oriented exception handling mechanism. A well written Java program, all run-time errors can and should be managed by your program itself.
Four, multithreading
One of the goals of Java design is to meet people's need to create interactive online programs. For this reason, Java supports multithreaded programming, so applications you write in Java can perform multiple tasks at the same time.
The Java runtime system has a sophisticated solution for multithreaded synchronization, allowing you to create a smooth, interactive system. Java multithreaded mechanism is very useful, so you only need to focus on the implementation of the details of the program, do not worry about the background of the multitasking system.
V. Structural neutrality
A major concern for Java designers is the persistence and portability of program code. One of the main problems programmers face is the inability to guarantee that the program you write today will run smoothly on the same machine tomorrow.
Operating system upgrades, processor upgrades, and changes to core system resources can cause programs not to continue running. The Java designer has tried many attempts at this problem, and the Java Virtual Machine (JVM) is trying to solve the problem. Their goal is "to write a program, anywhere, at any time, the program will always be able to run." To a large extent, Java has achieved this goal.
Vi. Explanatory and high performance
As mentioned earlier, Java can generate programs that run across platforms by compiling a program into an intermediate process such as Java bytecode. Bytecode can be interpreted on any system that provides a Java Virtual machine (JVM).
Many earlier attempts to address cross-platform scenarios have high performance requirements. Other language systems that interpret the execution, such as Basic,tcl,perl, have a performance flaw that cannot be overcome. However, Java can run smoothly on very low-grade CPUs.
As explained earlier, Java is indeed an interpretive language, and Java bytecode is carefully designed so that it is easy to use JIT-compilation techniques to convert bytecode directly into High-performance native code. The Java runtime system still has platform independence while providing this feature, so "efficient and cross-platform" is no longer contradictory to Java.
Vii. distributed
Java is designed for the distributed environment of the Internet because it handles the TCP/IP protocol. In fact, the difference between accessing a resource through a URL address and accessing a file directly is not significant.
The original Java version (Oak) includes the built-in address space message passing (Intra-address-space) attribute. This allows objects located on two different computers to perform procedures remotely. Java recently released a software package called Remote Method invocation (invocation, RMI), which has enabled client/server programming to achieve an unparalleled level of abstraction.
Viii. Dynamic
Java programs have a variety of run-time type information that is used to validate and resolve object access issues at run time. This makes it possible to dynamically connect code in a safe and efficient manner, and is also important for the robustness of the small application environment, where small pieces of code within a bytecode can be dynamically updated in a run-time system.
Green Tea Small Series Guess you also like:
Memory saving tips for Java programming: improving productivity
Java Beginner's Primer: 30 Java Basic concepts that beginners must master