Sealed Class in Java with Examples
Get Job-ready: Java Course with 45+ Real-time Projects! - Learn Java
Program 1
sealed interface MyInter1 permits MyInter2 { } non-sealed interface MyInter2 extends MyInter1 { } interface MyInter3 extends MyInter1 { } class TestSealed { public static void main(String args[]) { } } // sealed class First permits Second,Third // { // } // sealed class Second extends First permits Four // { // } // non-sealed class Four extends Second // {}
Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google