17 December 2020

#Java-15

Topic Content
Sealed class
  • Before Java 15, developers could only use final keyword or scope modifiers to control inheritance. So, sealed classes brings the added flexibility for Java developers when defining class hierarchies.
  • Permitted subclass
    • A permitted subclass that's declared final cannot be extended further.
    • It can be extended further but only by classes that are permitted by the subclass.
    • It may be declared non-sealed can be extended further by any class.
    • The superclass cannot restrict the subclasses further down this class hierarchy.
  • Java's Reflection API also gets two new methods for dealing with sealed classes
Pattern Matching for instanceOF
  • A type test pattern (used in instanceof) consists of a predicate that specifies a type, along with a single binding variable
Text Blocks
  • A text block is a multi-line string literal
  • While using text blocks, we do not need to provide explicit line terminators, string concatenations, and delimiters otherwise used for writing the normal string literals.
Records
  • The record is a new type of class in Java that makes it easy to create immutable data objects
  • Originally introduced in Java 14. Java 15 aims to refine a few aspects before becoming an official product feature.
  • It automatically implement data-driven methods such as constructors, accessors, equals(), hashCode() and toString().
  • Local Records
EdDSA Algorithm
  • EdDSA (Edwards-Curve Digital Signature Algorithm) is another additional digital signature scheme added
  • Does not change the execution time based on the length of secret key.

No comments:

Post a Comment

Most views on this month