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

Explain the top reason to use c# language?

0 Answers  


Can you describe iuknown interface in short?

0 Answers  


update data in an xml file which resides in solution itself, using silverlight 4.0

0 Answers  


What are examples of desktop applications?

0 Answers  


How to find the current application file path while runtime?

0 Answers  


What are scriptable objects?

0 Answers  


Explain the difference between boxing and unboxing.

0 Answers   Accenture,


Why objects are stored in heap in c#?

0 Answers  


Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?

0 Answers  


How do I create a single-file assembly?

0 Answers  


My switch statement works differently! Why?

0 Answers  


What is binary search tree in data structure?

0 Answers  


Categories