Limitations

When you use the record keyword to define your data class, you'll be limited by what the language allows you to do. You'll no longer have fine control over whether your data class is extensible, whether its state is mutable, the range of values that can be assigned to your fields, the accessibility to your fields, and so on. You might also be limited when it comes to having additional fields or multiple constructors.

Data classes are still in progress at Oracle. The finer details are still being worked on. In March 2018, the datum keyword was used to define a data class but has now been changed to record.

Nowadays, developers aren't limited to working with a single programming language. Java programmers usually work with or are aware of, other programming languages that work on the JVM, such as Scala, Kotlin, or Groovy. The experience of working with varied languages brings a lot of expectations and assumptions about the capabilities and limitations of the data classes (defined using record).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.173.53