Đang chuẩn bị liên kết để tải về tài liệu:
Language Features of Java Generics

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

ava™'s growth over the last five years has been nothing short of phenomenal. Given Java's rapid rise to prominence and the general interest in networking, it's a little surprising that network programming in Java. | Java Pro - Language Features of Java Generics http://www.ftponline.com/javapro/2004_03/online/j2ee_kkr. Implementing Java Generics Print Article Rough edges aside, see how the addition of Java Generics adds substantial expressive power to the Java programming language by Klaus Kreft and Angelika Langer Posted March 10, 2004 Editor's Note: This is the second of two installments presenting an overview of Java Generics, a new language feature that will be supported in the upcoming release of Java 2 Platform, Standard Edition 1.5. The first installment—"Language Features of Java Generics," Java Pro Online, March 3, 2004—discussed Java collections and generic treatment of types and classes. This concluding installment will look at generic treatment of methods as well as implementation and use of Java Generics. Types aren't the only components that can be parameterized. In addition to generic classes and interfaces, we can define generic methods. Static and nonstatic methods as well as constructors can be parameterized in pretty much the same way as we described parameterizing types previously (see "Language Features of Java Generics," Java Pro Online, March 3, 2004). The syntax is a little different, as you'll see. Everything said about type variables of parameterized types applies to type variables of parameterized methods in the exact same way. See Listing 1 for an example of a parameterized static method: max(). Parameterized methods are invoked like regular nongeneric methods. The type parameters are inferred from the invocation context. In our example, the compiler would invoke max() automatically. The type inference algorithm is significantly more complex than this simple example suggests, and exhaustive coverage of type inference is beyond the scope of this discussion. For the sake of completeness let's touch briefly on wildcards. So far we have been instantiating parameterized types using a concrete type that replaces the type parameter in the .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.