Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Can you prevent your class from being inherited and becoming
a base class for some other classes?

Answers were Sorted based on User's Feedback



Can you prevent your class from being inherited and becoming a base class for some other classes?..

Answer / umesh

Yes, that?s what keyword sealed in the class definition is
for. The developer trying to derive from your class will get
a message: cannot inherit from Sealed class
WhateverBaseClassName. It?s the same concept as final class
in Java.

Is This Answer Correct ?    12 Yes 2 No

Can you prevent your class from being inherited and becoming a base class for some other classes?..

Answer / neerajtyagi

You can prevent your class being derived using sealed
keyword.

But you can't use that class as base class once you make
that sealed.

Sealed and Derived both are opposite.

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is a destructor in c#?

0 Answers  


What is append in c#?

0 Answers  


What is lock in c#?

0 Answers  


What is thread life cycle in c#?

0 Answers  


what is the difference between int and Int32?

5 Answers   TCS,


Do unused Namespaces in c# affect run-time performance?

0 Answers   HCL,


what are implementation inheritance and interface inheritance?

0 Answers  


What is c# used for?

0 Answers  


What is default method in c#?

0 Answers  


What are properties in c#. Explain with an example?

0 Answers  


Which namespaces are necessary to create a localized application?

0 Answers   MindCracker,


In which situation(s), the use of "Delegate" is a good idea?

0 Answers   MCN Solutions,


Categories