Diamond Syntax Alternative for Jdk 1.6
Could Anyone Suggest How the Code Below Could Be Re-Written Such That It Works with Jdk 1.6, Please? Private Map dataTracking = New Hashmap(); 7 1 Answer Java...
Could anyone suggest how the code below could be re-written such that it works with JDK 1.6, please?
private Map<SocketChannel, byte[]> dataTracking = new HashMap<>();
1 Answer
Java 6 doesn't support the diamond operator. You'll have to copy the generic specification to the new call too:
private Map<SocketChannel, byte[]> dataTracking = new HashMap<SocketChannel, byte[]>();