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 a class from overriding?

Answers were Sorted based on User's Feedback



Can you prevent a class from overriding?..

Answer / techy_unknown

Hi,

I think the question itself is illogical.

The term "overriding" is ONLY and ONLY associated with
methods/properties not to the class.

So, if the question is put a like, "How to prevent methods
not to be overriden?" then the answer is: "Make them non-
virtual."

And if the question is put a like, "How to prevent the
inheritance for a specific class?" then the answer
is, "Make the calss sealed."

I really hope that the reply makes sense here.

Is This Answer Correct ?    38 Yes 1 No

Can you prevent a class from overriding?..

Answer / aa

make the class sealed

Is This Answer Correct ?    6 Yes 7 No

Can you prevent a class from overriding?..

Answer / nazrul

we can use sealed keyword at the time of declartion of class
thorugh which it won't inherit and won't be overide.

Is This Answer Correct ?    4 Yes 6 No

Post New Answer

More C Sharp Interview Questions

WHAT IS THE DIFFERENCE BETWEEN STRING AND STRING BUILDER ?

3 Answers  


Explain About remoting and web services. Difference between them

0 Answers   Microsoft,


What is the difference between namespace and class in c#?

0 Answers  


Difference between multi-level and multiple inheritance?

17 Answers   Microsoft,


explain the three services model commonly know as a three-tier application.

0 Answers   Siebel Systems,


How do you declare an arraylist?

0 Answers  


Does c# support multilevel inheritance?

0 Answers  


What is the difference between Object and class adapters?

0 Answers   QuestPond,


How do you specify a custom attribute for the entire assembly (rather than for a class)?

0 Answers  


Can an interface inherit an interface

1 Answers   Synechron,


What do you understand by an Implicit Variable?

0 Answers   CGI,


What is the difference between Hash Table and Arrays?

12 Answers   IBM,


Categories