Of course they can! They can implement interfaces, which are sealed. In fact, that's one of their most common usages:
sealed interface Option {
record InputFile(Path path) implements Option {}
record OutputFile(Path path) implements Option {}
record MaxLines(int maxLines) implements Option {}
record PrintLineNumbers() implements Option {}
}
(see https://www.infoq.com/articles/data-oriented-programming-jav...)The problem of extending classes is that it can introduce hidden state and also result in non-reflexive equality. But interfaces are fine.