- 多态实现:编译时-overload,运行时-override
- 循环效率:少量foreach,大量entryset(基础for最快,可读性不好,边界延伸)
- jeps:https://openjdk.org/jeps/(444,453,440,441,430)
- IO基础:缓冲区及如何处理缓冲区`
apache commons ioutils/apache common fileutils/getResourceAsStream
FileInputStream (jdk)(效率一般)
java.nio.file.Files.readAllBytes/newBufferedReader(Path())(不需要第三方)
RAF(可能存在线程安全问题) - stream
## 无限流(limit)
##### 有序无限流(iterate/range)
- List<Integer> intsIterate = IntStream.iterate(0, i -> i +
2).mapToObj(Integer::valueOf).limit(10).collect(Collectors.toList());
- List<Integer> intsRange = IntStream.range(0,
20).mapToObj(Integer::valueOf).limit(10).collect(Collectors.toList());
##### 无序无限流(generate)
- List<Integer> randomNumbers = Stream.generate(() -> (new
Random()).nextInt(100)).limit(10).collect(Collectors.toList());
## 包装流(boxed)
基础类流转换为包装类流
【待处理】
Java 11 Features (LTS)
HTTP Client API
Launch Single-File Programs Without Compilation
String API Changes
Collection.toArray(IntFunction)
Files.readString() and Files.writeString()
Optional.isEmpty()
Java 10 Features
JEP 286: Local Variable Type Inference
JEP 322: Time-Based Release Versioning
JEP 304: Garbage-Collector Interface
JEP 307: Parallel Full GC for G1
JEP 316: Heap Allocation on Alternative Memory Devices
JEP 296: Consolidate the JDK Forest into a Single Repository
JEP 310: Application Class-Data Sharing
JEP 314: Additional Unicode Language-Tag Extensions
JEP 319: Root Certificates
JEP 317: Experimental Java-Based JIT Compiler
JEP 312: Thread-Local Handshakes
JEP 313: Remove the Native-Header Generation Tool
New Added APIs and Options
Removed APIs and Options
Java 9 Features
Java platform module system
Interface Private Methods
HTTP 2 Client
JShell – REPL Tool
Platform and JVM Logging
Process API Updates
Collection API Updates
Improvements in Stream API
Multi-Release JAR Files
@Deprecated Tag Changes
Stack Walking
Java Docs Updates
Miscellaneous Other Features
Please see the updated release info here.