Java tries to solve the complexity of software writing in a new way. Many people think that the Java language has done everything it promises. But Java is not a perfect language.
Not all projects and environments require enterprise-level complexity, such as a simple personal web site or a program written by a programmer who is programming alone. These programmers will find that Java's complex management is too powerful for the program they're going to do.
Some people feel that Java does not have Ruby and Smalltalk purity on object-oriented objects. But the latest Java-implemented language, groovy, solves these problems.
As an established new technology, Java is clearly a combination of many language features, such as C + +, C language, Python and so on. Some comments about Java suggest that the invariance of Java is wavering.
Language problems
Some programmers do not like the separation of the original type (primitive type) and Class (class), especially those who have used Smalltalk and Ruby.
Java code is too verbose relative to other code, which contradicts its lightweight declaration.
Java is a single layer of inherited language. This also leads to the programmer's inconvenience in trying to use multiple inheritance, which many languages can use. But Java can use interface classes to minimize the risk that multiple inheritance can cause.
Java does not support operator overloading, which is to prevent operator overloading from making the functionality of the code unclear. But Java-implemented language groovy can be overloaded with operators.
Java used to manipulate text and other languages, such as Perl and PHP, but Java introduced regular expressions in version 1.4.
To be precise, Java is not platform-independent, it is a platform in itself.
Class Library issues
A program with a GUI (graphical user interface) written using the swing platform is very different from other original programs. The programmers who use the AWT Toolkit are looking at the original interface and can't get advanced GUI programming support, and it's a huge project to provide the APIs needed on each platform if you're using it. Swing is a program written entirely in the Java language, avoiding the problem of duplication of interface elements, using only the most basic mapping mechanisms supported by all platforms. But many users do not know how to convert between Java style and Windows style, resulting in a Java programming interface that is very special in many programs. The Apple Computer already offers optimized Java runtime programs that contain the classic Aqua interface style of Mac OS X.
Performance issues
Because the differences between Java compilers and virtual machines affect the performance of Java code much more than the language itself, the performance of a unified discussion Java program is often misleading. According to IBM, the 2001-year version of the IBM JDK on the same hardware was about 10 times times the JDK version of 1996. See the IBM Institute of Tokyo Information: Http://www.is.titech.ac.jp/ppl2004/proceedings/ishizaki_slides.pdf and even at the same time, the performance of the JDK and JRE for different companies is not the same, For example, companies such as Sun, IBM and Bea have their own JDK and JRE developed.
Some features of the Java language inevitably have additional performance costs, such as array range checking, run-time type checking, and so on. The performance of the Java program can also vary depending on the dynamic complexity and how much the garbage disposal mechanism uses. These features can even increase the performance of memory allocations if the JVM implementations are more optimized. This is similar to a program that always uses STL or managed C + +.
However, there are still many people who think that Java performance is low. This is partly due to Sun's initial JVM implementations using an not-optimized interpretation mechanism to execute bytecode. Some new versions of the JVM use the Just-in-time (JIT) compiler to compile the bytecode into local code for the running environment to implement some of the local compiler optimization features. The performance comparison between just-in-time mechanism and local compilation is still a controversial topic. JIT compilation takes a lot of time and is not appropriate for large programs that run for a long time or have a lot of code. But not the JIT compilation phase, the performance of the program in many JVMs can and local compiled program for a long time, even in some computationally intensive numerical computing field is the case. At present, Java has used more advanced hotspot technology to replace the JIT technology, Java performance has been further improved. Also, when you run the Java program using the-server option, Java can also be more in-depth optimization, such as the runtime will invoke more methods inline (inline) to the program to improve the speed, this is called "Dynamic Optimization", and the local compiler is not able to do this , which is one of the reasons that some Java code runs faster than native code written in languages such as C + +. Microsoft's. NET platform also uses the JIT compiler, so there are similar problems. Java is designed primarily for security and portability, so some features, such as direct access to hardware architectures and memory-address access, are removed. If you need to invoke these low-level functions indirectly, you need to use the JNI (Java local interface) to invoke the local code, while indirect access means that the performance loss is great when you call these features frequently, and Microsoft's. NET platform has this problem. So so far, performance-sensitive code, such as drivers and 3D video games, has mostly been compiled locally, even directly with C language or machine code that doesn't directly support object-oriented objects. But recently there have been many 3D games written in pure Java, with the same effect as written in C, such as "Alloy Warrior" (English Name: Chrome). This is mainly because the new version of the Java 3D Technology has been able to call hardware acceleration like C + +, that is, using graphics to speed up, whether it is in C + + or the Java language of 3D games are used graphics and GPU to deal with, so that the CPU can focus on other aspects of the work.
For Java performance, refer to the following article:
Http://www-128.ibm.com/developerworks/cn/java/j-jtp09275.html
Http://www.matrix.org.cn/thread.shtml?topicId=16092&forumId=18