Java eight great advantages you must know before learning Java

Source: Internet
Author: User

Java Eight great advantages you must know before learning Java

Why do we have to learn the eight great advantages of Java:java

Java has a simple, object-oriented, stable, platform-independent, interpretive, multi-threading, dynamic and other characteristics, it is a must-have tool.
Why do we have to learn Java? Why does Java attract people's attention? Don't...... That's the root of Java:

1. Java is currently one of the most widely used network programming languages. It has simple, object-oriented, stable, platform-independent, interpretive, multi-threading, dynamic and other characteristics.

2. Simple Java language simple refers to the language is easy to learn and useful. Don't make the simple misunderstanding that the language is very withered. You may well agree that English is easier to learn than the language of AH-bo. But this does not mean that English can not express rich content and profound thought, many literary Jobert prize works are written in English. If you have learned the C + + language, you will feel Java is familiar, because many of the basic statements in Java syntax and C + +, like the usual loop statements, control statements and so on and C + + almost the same, but do not misunderstand that Java is an enhanced version of C + +, Java and C + + are two completely different languages, They each have their own advantages, will be long-term coexistence, the Java language and C + + language has become a software developer should master the language. If you look at the simplicity of the language, Java is simpler than C + +, many confusing concepts in C + +, either discarded by Java, or implemented in a clearer and easier-to-understand way, for example, Java no longer has the concept of pointers.

3. Object-oriented programming is more consistent with human thinking patterns, making it easier for people to write programs. In real life, we are dealing with objects every moment of the day. We use pens, bike rides, buses, etc. And we often see trucks, buses, cars and so will involve the following several important physical quantities can be carried on the number of people, operating speed, engine power, fuel consumption, weight, number of wheels and so on. In addition, there are several important functions of acceleration function, deceleration function, braking, turning function and so on. We can also call these functions the methods they have, and the physical quantities are their state descriptions. They are not well described by mere physical quantities or functions. In real life, we use these common attributes and functions to give a conceptual motor vehicle class. A specific sedan is an instance object of a motor vehicle class. The Java language, like other object-oriented languages, introduces the concept of a class, which is the template used to create an object that contains the state description of the object being created and the definition of the method.

4. Platform agnostic and platform agnostic are the biggest advantages of the Java language. A major problem with programs written in other languages is the changes in operating systems, processor upgrades, and changes in core system resources, which can cause programs to fail or run out of control. Java's virtual machine successfully solves this problem, and Java-written programs can run correctly on any computer where the Java Virtual machine JVM is installed, and Sun realizes its own goal, "write once, run everywhere."

5. Explanatory type We know that languages such as c,c++ can only be compiled for a particular CPU chip, generating machine code that runs on a particular cup. For example, in the C language, we have encountered a problem like the following, the value of the int variable is 10, then what is the output of the following code? printf ("%d,%d", x,x=x+1) if the above statement is evaluated from left to right, the result is 10,11 but, Some machines are calculated from right to left, so the result is 11,11.java unlike C + +, which does not compile for a particular CPU chip, but rather compiles the program into an "intermediate code" called bytecode. Bytecode is a file that is close to the machine code and can be interpreted on any system that provides a Java virtual machine JVM. Java is designed to explain the execution of the program, that is, to translate a sentence, to execute a sentence, does not produce the entire machine code program. If there is no error in the translation process, it will be completed until the error is stopped. The same program, if interpreted, runs at a slower rate than the machine code compiled to execute. However, for Java, the difference between the two is not too large, Java bytecode has been carefully designed, it is easy to use JIT compilation technology to directly convert bytecode to high-performance local machine code, Sun company in the Java 2 release version of such a byte code compiler--jit ( Just in time), which is part of the Java Virtual machine. The Java runtime system is still platform independent while providing JIT, so "efficient and cross-platform" is no longer contradictory to Java. If the Java program than do "Chinese", bytecode is the equivalent of "Esperanto", Esperanto is not and specific "state", as long as the "country" provides "translation", you can quickly translate Esperanto into local language.


6. One of the features of multithreaded Java is the built-in support for multithreading. Multithreading allows multiple tasks to be completed at the same time. In fact, multithreading makes the illusion that multiple tasks are performed simultaneously, because the processor of the current computer can only execute one thread at a time, but the processor can switch quickly between different threads, because the processor is very fast, far more than the speed at which people receive information, So it feels like multiple tasks are executing at the same time. C + + does not have a built-in multithreading mechanism, so you must invoke the multithreaded capabilities of the operating system to design multi-threaded threads.

7. Security when you are ready to download a program from the network, your biggest worry is that the program contains malicious code, such as trying to read or delete some important files on the local machine, or even the program is a virus program. When you use a Java-enabled browser, you can safely run Java applet Java applets without worrying about virus infection and malicious attempts, and Java applets will be restricted to the Java runtime and not allow it to access other parts of the computer.

8. The basic components of a dynamic Java program are classes, some classes are written by themselves, some are introduced from the class library, and classes are dynamically loaded at runtime, which allows Java to dynamically maintain programs and class libraries in a distributed environment, unlike C + +, whenever its class library is upgraded, The corresponding program must be re-modified, compiled.

Java eight great advantages you must know before learning Java

Related Article

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.