First: Simplicity: We all know that Java is one of the most widely used network programming languages. It is easy to learn and use. If you have studied the C++ language, you will feel that C++ is very similar to Java, because the syntax of many basic sentences in Java is the same as C++, such as commonly used loop statements and control statements. In fact, Java and C++ are two completely different languages. As long as Java understands some basic concepts, it can be used to write applications suitable for various situations. Java omits vague concepts such as operator overloading and multiple inheritance, and many confusing concepts in C++ are abandoned by Java or implemented in a more clear and understandable way, so the Java language is relatively simple.
Second: security: When you plan to download a software or other resources from the Internet, you are most concerned about whether there is malicious code in it, for example, the program is a virus program. Because Java doesn't support pointers, all accesses to memory must be realized through instance variables of objects, which avoids programmers from using "Trojan Horse" and other deceptive means to access private members of objects, and also avoids errors that are easy to occur in pointer operation. So don't worry about virus infection and malicious attempts.
Third: multithreading: One of the characteristics of Java is its built-in multithreading. Multithreading allows multiple tasks to be completed at the same time. C++ has no built-in multithreading mechanism, so it needs to call the multithreading function of the operating system to design multithreaded programs. The multithreading mechanism enables applications to execute in parallel, and the synchronization mechanism ensures the correct operation of data. By using multithreading, programmers can use different threads to complete specific behaviors without adopting the global event cycle mechanism, so it is easy to realize real-time interactive behaviors on the network.
Fourthly, it is dynamic: the basic unit of Java programs is classes, and classes are dynamically loaded at runtime, which makes Java dynamically maintain programs and class libraries in a distributed environment, unlike C++, when its class libraries are upgraded, the corresponding programs must be revised and compiled again. Java can freely add new methods and instance variables to the class library without affecting the execution of user programs. Moreover, Java supports multiple inheritance through interfaces, which makes it more flexible and extensible than strict class inheritance.
Fifth, portability: Java provides the simplest and most familiar portability-source code transplantation. This means that any Java program, no matter what CPU, operating system or Java compiler it runs on, will produce the same result. This is not a new concept. People can use C and C++ to produce the same effect. But using C or C++ programming is not strictly defined in many details. Java has a broad application prospect on the Internet because of its portability. At the same time, its anti-virus ability also makes it occupy a place in applications that need high reliability.
6. Great market prospect: At present, the market share of java language in computer language reaches 20%, making it the first programming language in the world. According to statistics, the demand for software development talents in China has reached 600,000, and it is growing at a rate of about 22% every year. Among them, the most lacking are Java programmers and Java engineers. In the next five years, the demand for qualified software developers will far exceed the supply. From this point of view, the java development market is infinite.