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.
两条线有什么区别吗?
SomeClassOrInterface<Type1> name = new SomeClass<Type1>(); SomeClassOrInterface<Type1> name = new SomeClass<>();
第二种语法仅在 Java 7 上有效,而前者在 Java 5+ 上有效