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


What are Sealed Classes in C#?

Answers were Sorted based on User's Feedback



What are Sealed Classes in C#?..

Answer / mukesh kumar

A class which restricts inheritance for security region is
called Sealed class.
Sealed class is the last class in hierarchy that why a
sealed class can be a derived class but can never be a base
class.
To access the members of sealed class we should create the
instance object.

Advantages of sealed class is it restrict the third party
vendor for developing new software by inheriting from our
logic.

Is This Answer Correct ?    4 Yes 0 No

What are Sealed Classes in C#?..

Answer / gpriya

A sealed class cannot be inherited. It is an error to use a
sealed class as a base class. Use the sealed modifier in a
class declaration to prevent inheritance of the class.

It is not permitted to use the abstract modifier with a
sealed class.

Structs are implicitly sealed; therefore, they cannot be
inherited.

Is This Answer Correct ?    4 Yes 0 No

What are Sealed Classes in C#?..

Answer / chauhan rakesh botad

sealed classes cannot be inherited.

Is This Answer Correct ?    2 Yes 0 No

What are Sealed Classes in C#?..

Answer / chauhan rakesh botad

A class which restricts inheritance for security region is
called Sealed class.
Sealed class is the last class in hierarchy.
Sealed class can be a derived class but can't be a base class.
To access the members of sealed class we should create the
instance object.

Advantages of sealed class is it restrict the third party
vendor for developing new software by inheriting from our logic.

Is This Answer Correct ?    2 Yes 0 No

What are Sealed Classes in C#?..

Answer / saba

Sealed classes are used to restrict the inheritance feature
of object oriented programming. Once a class is defined as
sealed class, this class cannot be inherited.

The following class definition defines a sealed class in C#:


// Sealed class

sealed class SealedClass

{

}

In the following code, I create a sealed class SealedClass
and use it from Class1. If you run this code, it will work
fine. But if you try to derive a class from sealed class,
you will get an error.


using System;

class Class1

{

static void Main(string[] args)

{

SealedClass sealedCls = new SealedClass();

int total = sealedCls.Add(4, 5);

Console.WriteLine("Total = " + total.ToString());

}

}

// Sealed class

sealed class SealedClass

{

public int Add(int x, int y)

{

return x + y;

}

}

Is This Answer Correct ?    2 Yes 0 No

What are Sealed Classes in C#?..

Answer / uday shah

above answer is correct.sealed class is not inherited and
doesnot make drived class.means sealed class isnot
subclassing.sealed class is only parent class.so selaed
method is not overriding.

Is This Answer Correct ?    4 Yes 3 No

What are Sealed Classes in C#?..

Answer / m.ramkumar

prevent the class in further using subclasses;

Is This Answer Correct ?    2 Yes 1 No

What are Sealed Classes in C#?..

Answer / jp goswsmi

sealed Class that cannot be inherited and used by the other
classes

Is This Answer Correct ?    1 Yes 0 No

What are Sealed Classes in C#?..

Answer / vijay pandey

when u add a sealed keyword to the class declaration then the class can not be inherited
1-it is restriction from modification

Is This Answer Correct ?    1 Yes 0 No

What are Sealed Classes in C#?..

Answer / ravikumar

all above answers are correct but i have doubt regarding
private classes

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C Sharp Interview Questions

Explain data types in c#?

0 Answers  


Int map to which .net types?

0 Answers  


Does c# support multiple class inheritance?

0 Answers  


Why does dllimport not work for me?

0 Answers  


Why can’t struct be used instead of class for storing entity?

0 Answers  


what is main function of alternate teamplate of datalist?

0 Answers  


What does out mean in c#?

0 Answers  


What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?

6 Answers   Wipro,


Can you call from an inherited constructor to a specific base constructor if both base class and an inheriting class has a number of overloaded constructors?

0 Answers   Siebel,


what is the difference between convert.tostring() and tostring() functions ?

0 Answers   QuestPond,


What is executescalar in c#?

0 Answers  


Which one is trusted and which one is untrusted?

0 Answers  


Categories