220: Modular Run-Time Images • JEP 260: Encapsulate Most Internal APIs • JEP 261: Module System • JEP 282: jlink: The Java Linker JSR 376: JAVA PLATFORM MODULE SYSTEM
AN IDENTIFIER NAME Java 8: warning: '_' used as an identifier int _ = 1; ^ (use of '_' as an identifier might not be supported in releases after Java SE 8)
{} private void methodB() {} private static void methodC(){} private default methodD(){} } // since Java 8 // new in Java 9 // new in Java 9 // error: cannot be // private and default
set.add("b"); set.add("c"); set = Collections.unmodifiableSet(set); Set<String> set = Collections.unmodifiableSet( new HashSet<>(Arrays.asList("a", "b", "c")));
set.add("b"); set.add("c"); set = Collections.unmodifiableSet(set); Set<String> set = Collections.unmodifiableSet( new HashSet<>(Arrays.asList("a", "b", "c"))); Set<String> set = Collections.unmodifiableSet( Stream.of("a", "b", "c").collect(toSet()));