Skip to content
Preptima

Modern Java Features interview questions

Records, sealed types, pattern matching, and the language changes that reshape idiomatic code.

3 questions in Java & Spring.

medium2

mediumConceptDesign

How do records, sealed types and pattern matching change the way you model a domain?

Together they let you write closed data hierarchies the compiler can check. A record declares that a type is its components, a sealed interface enumerates the permitted variants, and an exhaustive switch over record patterns turns adding a variant into a compile error at every place that handles them.

5 minmid, senior, staff

hard1