Skip to content

Instantly share code, notes, and snippets.

@nowshad-hasan
Created October 9, 2021 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nowshad-hasan/35f5c788175aa2d741c88add196ba788 to your computer and use it in GitHub Desktop.
Save nowshad-hasan/35f5c788175aa2d741c88add196ba788 to your computer and use it in GitHub Desktop.
public class SealedClassWithRecordExample {
sealed interface Exam permits Student {
void giveExam();
}
record Student(String name, String rollNumber) implements Exam {
@Override
public void giveExam() {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment