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

Wats the diff between sealed class and private class in
inheritance

Answer Posted / vishal

Sealed Class:
When applied to a class, the sealed modifier prevents other
classes from inheriting from it. In the following example,
class B inherits from class A, but no class can inherit
from class B.

class A {}
sealed class B : A {}

You can also use the sealed modifier on a method or
property that overrides a virtual method or property in a
base class. This enables you to allow classes to derive
from your class and prevent them from overriding specific
virtual methods or properties.


Private Class :

Classes and structs that are not nested within other
classes or structs can be either public or internal. A type
declared as public is accessible by any other type. A type
declared as internal is only accessible by types within the
same assembly. Classes and structs are declared as internal
by default unless the keyword public is added to the class
definition. And yes, a class cannot be private unless of
course if it a nested class.

Is This Answer Correct ?    29 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c# support templates?

975


Which is better javascript or c#?

913


What is delegate in c#?

956


What are the return types in c#?

957


Why do I get a syntax error when trying to declare a variable called checked?

1004


Helo , Help Me , Help Me About : C# Windows Application - Network How To Manage IP Client's Accessiblity To The Internet Share concise Substitute , Minor ISA Server

1956


Explain inheritance in c#?

949


what is the syntax to inherit from a class in c#?

1013


Describe the overview of clr integration.

978


Define multicast c# delegate?

960


What is function and method in c#?

995


Is Multiple-inheritance supported by c#?

988


Explain the difference between private and shared assembly?

891


What is using keyword?

909


If I want to override a method one of class A and in class b then how do you declare?

1306