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 / guest

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 ?    2 Yes 1 No

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

Answer / srivathsan

@ guest...
the answer is not incomplete.

it is implicit. Rakesh wants to tell that the sealed
methods cannot be inherited from a class that is not
sealed, even when you inherit other members from a class
that is not decorated with the keyword sealed.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / rakesh

We can also make the methods sealed.In that case ,the class
can inherit but the sealed methods in that class cannot

Is This Answer Correct ?    0 Yes 0 No

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

Answer / guest

Rakesh are u keeping us in Suspense?

u must complete the answer.

but the sealed methods in that class cannot........??????

Is This Answer Correct ?    0 Yes 0 No

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

Answer / pank

Make your class constructor as Private then it will restrict from being inherit as well as instantiate.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Why do we need serialization?

0 Answers  


how to Create a datagridview control with check box column with 8rows in it, the maximum number of check boxes checked should be 3, when user checks the 4th corresponding message should be displayed and check box should be checked. User can uncheck the checked boxes Note: read-only property should not be used

0 Answers   HCL, NIC,


Define multicast delegate in c#?

0 Answers  


What is the difference between gettype and typeof in c#?

0 Answers  


How do I know if executenonquery is successful c#?

0 Answers  


What is the use of 'using' statement in c#?

0 Answers  


What is escape character in c#?

0 Answers  


How do I create a dbml file?

0 Answers  


Explain constructor.

7 Answers   Wipro,


What is class sortedlist underneath?

0 Answers  


Write a short note on interface?

0 Answers  


Where do I put dll files?

0 Answers  


Categories