java class declaration <T>
问题 I'm familiar with simple class declaration public class test but I don't understand public class test<T> . 回答1: < T > refers to a generic type. Generic types are introduced in Java to provide you with compile time, and this is important due to type erasure, type-safety. It's especially useful in Collections because it frees you from manual casting. It is a good idea to read more on generics, especially the documentation on the topic by Angelika Langer is very good: http://www.angelikalanger