As Java 9 has been released few days ago, I went through the [What's New](https://docs.oracle.com/javase/9/whatsnew/toc.htm) to see if there is something useful in the context of Competitive Programming. And I didn't find much, just these 2few enhancements:↵
↵
- new static factory methods on the List, Set, and Map interfaces (returning immutable instances of those collections), for example: `Set<String> alphabet = Set.of("a", "b", "c");`↵
↵
- internal String representation as array of bytes (8 bit) instead of array of chars (16 bit) in case the string contains only Latin-1 characters (which is normally the case in Competitive Programming); this would reduce memory consumption almost by half in String problems, and I wonder what would be the impact on performance;↵
↵
- JShell (aka REPL in some other languages) for executing small pieces of code / bruteforce solutions (thanks [user:bhishma,2017-09-23] for suggesting this).↵
↵
Also, there are some new standard library methods not mentioned in "What's new" (thanks [user:drinkless,2017-09-23] for pointing this out). Here's what I found: ↵
↵
- [Math.fma(a, b, c)](http://download.java.net/java/jdk9/docs/api/java/lang/Math.html#fma-double-double-double-) to compute `a * b + c` on doubles/floats with better performance and precision;↵
↵
- A few new Math.multiplyExact/multiplyFull/multiplyHigh methods;↵
↵
- [Arrays.equals](http://download.java.net/java/jdk9/docs/api/java/util/Arrays.html#equals-int:A-int-int-int:A-int-int-) to compare two subarrays;↵
↵
- [Arrays.compare](http://download.java.net/java/jdk9/docs/api/java/util/Arrays.html#compare-boolean:A-boolean:A-) to compare two arrays/subarrays lexicographically;↵
↵
- [Arrays.mismatch](http://download.java.net/java/jdk9/docs/api/java/util/Arrays.html#mismatch-boolean:A-boolean:A-) to compute common prefix length of two arrays.↵
↵
(Array methods should have efficient implementations using vectorised CPU instructions).↵
↵
As a personal note, I feel like Java is still light years behind Scala (which unfortunately is broken on CF for 2 months already) for writing CP code, even though both of them run on the same JVM. Just please, don't start language flame wars, unless you have tried both :)↵
↵
P. S. If someone goes through "What's new" of Java 9 and notices some more relevant enhancements, please post them here. I could have missed something.
↵
- new static factory methods on the List, Set, and Map interfaces (returning immutable instances of those collections), for example: `Set<String> alphabet = Set.of("a", "b", "c");`↵
↵
- internal String representation as array of bytes (8 bit) instead of array of chars (16 bit) in case the string contains only Latin-1 characters (which is normally the case in Competitive Programming); this would reduce memory consumption almost by half in String problems, and I wonder what would be the impact on performance;↵
↵
- JShell (aka REPL in some other languages) for executing small pieces of code / bruteforce solutions (thanks [user:bhishma,2017-09-23] for suggesting this).↵
↵
Also, there are some new standard library methods not mentioned in "What's new" (thanks [user:drinkless,2017-09-23] for pointing this out). Here's what I found: ↵
↵
- [Math.fma(a, b, c)](http://download.java.net/java/jdk9/docs/api/java/lang/Math.html#fma-double-double-double-) to compute `a * b + c` on doubles/floats with better performance and precision;↵
↵
- A few new Math.multiplyExact/multiplyFull/multiplyHigh methods;↵
↵
- [Arrays.equals](http://download.java.net/java/jdk9/docs/api/java/util/Arrays.html#equals-int:A-int-int-int:A-int-int-) to compare two subarrays;↵
↵
- [Arrays.compare](http://download.java.net/java/jdk9/docs/api/java/util/Arrays.html#compare-boolean:A-boolean:A-) to compare two arrays/subarrays lexicographically;↵
↵
- [Arrays.mismatch](http://download.java.net/java/jdk9/docs/api/java/util/Arrays.html#mismatch-boolean:A-boolean:A-) to compute common prefix length of two arrays.↵
↵
(Array methods should have efficient implementations using vectorised CPU instructions).↵
↵
As a personal note, I feel like Java is still light years behind Scala (which unfortunately is broken on CF for 2 months already) for writing CP code, even though both of them run on the same JVM. Just please, don't start language flame wars, unless you have tried both :)↵
↵
P. S. If someone goes through "What's new" of Java 9 and notices some more relevant enhancements, please post them here. I could have missed something.