How can we restrict inheritance for a class so that no class can be inherited from it?

By ayush goel in 22 Sep 2023 | 11:31 am
ayush goel

ayush goel

Student
Posts: 346
Member since: 21 Sep 2023

How can we restrict inheritance for a class so that no class can be inherited from it?

22 Sep 2023 | 11:31 am
0 Likes
divas goyal

divas goyal

Student
Posts: 453
Member since: 22 Sep 2023

 You can restrict inheritance for a class by using the `final` keyword. Marking a class as `final` means it cannot be subclassed.


23 Sep 2023 | 04:21 pm
0 Likes

Report

Please describe about the report short and clearly.