New Things of Java8+ and Less Noticed Old Features
Table of Contents
These notes are an overview of new features of Java 8 and up, as well as less noticed old features, such as closures.
1 Java 8+
- Lambda Expressions (Closures)
- Concurrency in Java
- Event Driven Programming
- JavaFX for GUI, Examples of Java/JavaFX Programs
- Sequential Streams
- Parallel Streams
- Futures and Callables
- Miscellaneous
- Improved Security
- Delegates
- Anonymous Classes
- Interfaces with Methods
- Java 11 https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html Nested Classes. Just like methods, variables of a class too can have other classes as its members.
- Java 12 https://blog.jetbrains.com/idea/2018/10/preview-raw-string-literals-in-intellij-idea-2018-3/
2 Scala
- Scala can be considered a "modern version" of Java.
- Elimination of "boiler plate" code: setters, getters, constructors auto generated.
- FOSS Project https://projectlombok.org/ does that for Java, by manipulating the ASTs.
- Syntax is substantially different.
- Design of Scala started in 2001.
- Type inference is an integral part of Scala.
- Has functional programming features also.
- ../Scala
3 Kotlin
- Kotlin == ++Java, Kotlin improves over Java.
- Less verbose: type inference, getter + setter methods, etc.
- Kotlin can be compiled into JVM byte code, as well as, native machine code. So, can Java.
- IntelliJ can "convert" Java source to Kotlin.
- Kotlin has coroutines, etc.
- Kotlin is the recommended dev language in Android SDK
- https://kotlinlang.org/docs/reference/comparison-to-java.html
4 References
- https://en.wikipedia.org/wiki/Java_version_history Required Reading.
- Oracle.com, Java Essentials Tutorial, https://docs.oracle.com/javase/tutorial/essential/TOC.html. This is the recommended tutorial. Reference.
- http://lambdafaq.org Maurice Naftalin's Lambda and friends FAQ. Includes streams, etc. 2015. Reference.
- David Svoboda, https://insights.sei.cmu.edu/sei_blog/2015/10/is-java-more-secure-than-c.html Is Java More Secure than C? Oct 2015. Recommended Reading.