Java and C++ are similar in several ways, including syntax, primitive types, and operators. But unlike C++, which was layered on top of C, Java has no legacy capabilities to support. Thus Java is a much cleaner and simpler language than C++. Java supports primitive types, so it is not a pure object language, but otherwise Java is thoroughly object-oriented. Throw in Java's network orientation, and it becomes clear why Java is a perfect match for the multi-tiered, multi-server, component-oriented environment of the future.
Yet the simpler design of Java sometimes gets in the way. Certain aspects of the language are stumbling blocks to developers. These are traps in the language itself, regardless of the class libraries used.
This article will concentrate on aspects of the Java language that may be surprising and perplexing to developers coming from C++ or from any language.
These Java "Gotchas" are not suggestions for changes to the language. While these are certainly possible enhancements to Java, many of the aspects are inherent to the basic design of the language. Changing them would do severe damage to Java.
Interfaces Interfaces are essential to the Java language. They provide for multiple inheritance as well as information hiding and code re-use. Interfaces are similar to abstract classes but have important restrictions:
Read full article from Java Gotchas
No comments:
Post a Comment