Created
October 9, 2021 13:57
-
-
Save nowshad-hasan/35f5c788175aa2d741c88add196ba788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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