Java 5 对比 Java 6
通过结构化对比表查看 Java 5 与 Java 6 的差异,然后继续浏览相关面试题、测验以及类似主题比较。
主题对比
Java 5 与 Java 6 的对比有助于你理解哪一种更适合自己的使用场景。这里也整理了 Java 6 和 Java 5 的常见对比内容,适用于面试准备。
Java 5 与 Java 6 的区别
Java 5 与 Java 6 的对比有助于你理解哪一种更适合自己的使用场景。这里也整理了 Java 6 和 Java 5 的常见对比内容,适用于面试准备。
|
Java 5
|
Java 6
|
|---|---|
| Features added: - Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion). - Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities. - Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as integer). - Enumerations: the enum keyword creates a typesafe, ordered list of values (such as day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern). - Swing: new skinnable look and feel, called synth. - Var args: the last parameter of a method can now be declared using a type name followed by three dots (e.g. Void drawtext(string... Lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type. - Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any iterable, such as the standard collection classesfix the previously broken semantics of the java memory model, which defines how threads interact through memory. - Automatic stub generation for rmi objects. - Static imports concurrency utilities in package java.util.concurrent. - Scanner class for parsing data from various input streams and buffers. - Assertions - StringBuilder class (in java.lang package) - Annotations |
Features added: - Support for older win9x versions dropped. - Scripting lang support: Generic API for integration with scripting languages, & built-in mozilla javascript rhino integration - Dramatic performance improvements for the core platform, and swing. - Improved web service support through JAX-WS JDBC 4.0 support - Java compiler API: an API allowing a java program to select and invoke a java compiler programmatically. - Upgrade of JAXB to version 2.0: including integration of a stax parser. - Support for pluggable annotations - Many GUI improvements, such as integration of swingworker in the API, table sorting and filtering, and true swing double-buffering (eliminating the gray-area effect). |
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
相关差异对比
探索与 Java 5 和 Java 6 相关的类似比较,以获得更广泛的背景和面试准备思路。
从下方查看差异对比
浏览下面所有可用的主题比较,或使用上方搜索框快速缩小范围。