Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in Java (Android N)

What's new in Java (Android N)

Lighting talk about what's new in Java in the Android N preview

Eugenio Marletti

March 30, 2016
Tweet

More Decks by Eugenio Marletti

Other Decks in Programming

Transcript

  1. Language: 7-ish ∞ diamond operator string switch multicatch K try-with-resources

    API: 6-ish K Throwable.addSuppressed() L ForkJoinPool JVM: 6 before N
  2. after N “ we’re looking forward to tracking the Java

    language more closely while maintaining backward compatibility ”
  3. lambdas method references after N Language: 8-ish ∞ N default

    & static methods in interfaces repeatable annotations API: 8-ish N streams functions optionals missing: date/time? (plz support lib!) JVM: 6 (still no invokedynamic)
  4. lambda method reference anonymous class new View.OnClickListener() {
 @Override
 public

    void onClick(View view) {
 doSomething(view);
 }
 } view -> doSomething(view) this::doSomething
  5. android { ... defaultConfig { ... jackOptions { enabled true

    } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } Getting started: developer.android.com/preview/j8-jack.html TL;DR 1. setup a project for the N preview 2. add this Gradle config: