Home »

How can you prevent your class to be inherated further?

Question ListCategory: .NETHow can you prevent your class to be inherated further?
jessica537 author asked 8 years ago
1 Answers
alisataylore190 author answered 8 years ago

By setting Sealed – Key wordpublic sealed class Planet { //code goes here }
class Moon:Planet { //Not allowed as base class is sealed }

Please login or Register to Submit Answer