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...

How would you stop a class from class from being derived or
inherited.

Answer Posted / anant tiwari

There are three way to stop a class been derived (example in C#)
1) declare a class as static (Ex : static class Sample {....}
2) declare the class constructor as private (Ex class Sample{ private Sample(){}....}
3) declare a class as sealed class Ex : sealed class Sample {...}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Templates mean

2153


Why oops is important?

1199


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

2205


What does and I oop mean in text?

1319


What are different oops concepts?

1113


What is property in oops?

1134


What is the advantage of oop over procedural language?

1134


What is polymorphism in oops with example?

1108


What are classes oop?

1094


Why is oop better than procedural?

1145


What are the important components of cohesion?

1080


What are the 3 pillars of oop?

1245


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

2204


Are polymorphisms mutations?

1217


What is polymorphism oop?

1114