Skip to content

Latest commit

 

History

History
49 lines (43 loc) · 2.83 KB

File metadata and controls

49 lines (43 loc) · 2.83 KB

Java Language Updates

Java Language Changes

  1. Section summarizes updated language features in Java SE 9 and subsequent releases

Java Language Changes for Java SE 14

  1. instanceof operator: pattern matching can be used
    1. If result is true, object tested is automatically assigned to variable previously declared
      1. Pattern Matching for the instanceof Operator
      2. Records: a kind of type declaration that is ideal for "plain data carriers"
        1. Classes containing data not meant to be altered but have fundamental methods such as constructors and accessors
        2. Records
  2. Programmer's Guide to Text Blocks
  3. Switch Expressions

Java Language Changes for Java SE 13

  1. Text blocks:
    1. Multiline string literals that don't require common escape sequences
  2. switch expressions
    1. yeild statement instead of break
      1. Switch expressions

Java Language Changes for Java SE 12

  1. switch expressions
  2. case label that prevents fall through
  3. Switch Expressions

Java Language Changes for Java SE 11

  1. var - identifier
    1. Local Variable Type Instance

Java Language Changes for Java SE 10

  1. Inferring type of local variables from context
  2. This makes code more readable and reduces amount of required boilerplate code

Java Language Changes for Java SE 9

  1. Module system
    1. It is named self-describing collection of code and data
    2. Code is organized as a set of packages containing
      1. Types
        1. Java classes
        2. Java interfaces
      2. Data
        1. Resources
        2. Static info
  2. Modules can export or encapsulate packages
    1. They can express dependencies on other modules explicitly
    2. Project Jigsaw
  3. More Concise try-with-resources Statements
  4. Small language Changes in Java SE 9