Java 10 for competitive programming

Revision en1, by eatmore, 2018-03-22 07:54:23

Java 10 has been released a few days ago, just six months after Java 9. In this version, I found only one new feature which is useful for competitive programming: Local-Variable Type Inferrence. It works similarly to auto keyword in C++. So now you can write something like this:

var map = new HashMap<Integer, List<String>>();
for (var entry : map.entrySet()) {
    var key = entry.getKey();
    for (var element : entry.getValue()) {
        System.out.println(key + " " + element);
    }
}

If you find any other relevant enhancements, please post them here.

Tags java

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English eatmore 2018-03-22 07:54:23 737 Initial revision (published)