Java 10 for competitive programming

Правка en1, от 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.

Теги java

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский eatmore 2018-03-22 07:54:23 737 Initial revision (published)