Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
只是想知道,您将如何使用泛型类型大声读出以下项目?
1) class Box<T> 2) Box<Integer> integerBox 3) class Box<T,U> 4) <T,U> void doSomething(T t, U u)
谢谢
1) class Box<T> Box of T 2) Box<Integer> integerBox Box of Integer 3) class Box<T,U> Box of T,U 4) <T,U> void doSomething(T t, U u) Just a method which accepts two type parameters T and U
参考:
Generics Tutorial
Java Generics FAQs - Frequently Asked Questions