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.
任何人都可以建议如何重写下面的代码以使其适用于 JDK 1.6,好吗?
private Map<SocketChannel, byte[]> dataTracking = new HashMap<>();
Java 6 不支持菱形运算符。您还必须将通用规范复制到new调用中:
new
private Map<SocketChannel, byte[]> dataTracking = new HashMap<SocketChannel, byte[]>();