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 the state of Garbage Collection after dispose() call info C# code?

4 Answers  


How you will handle session when deploying application in more than a server? Describe session handling in a webform, how does it work and what are the limits?

3 Answers   Microsoft,


Which is faster hashtable or dictionary?

0 Answers  


Which layer executed first among these Application layer,Buisness layer or Data Base Layer?

2 Answers   L&T,


Is c# int immutable?

0 Answers  


What is an assembly qualified name? Is it a filename? How is it different?

0 Answers  


What does a constructor do c#?

0 Answers  


Does the variables of a private class-level inherited?

0 Answers   Siebel,


What?s a delegate?

2 Answers  


How do you create dlls in .NET

0 Answers   Digital GlobalSoft,


What is main thread in c#?

0 Answers  


What does the keyword “virtual” declare for a method or property?

0 Answers   Siebel,


Categories