Can you prevent your class from being inherited and becoming
a base class for some other classes?
Answer Posted / umesh
Yes, that?s what keyword sealed in the class definition is
for. The developer trying to derive from your class will get
a message: cannot inherit from Sealed class
WhateverBaseClassName. It?s the same concept as final class
in Java.
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
What are the drawbacks of extending an interface as opposed to extending a class?
Why do we use delegates in c#?
What is readline library?
What is ienumerable and iqueryable?
What are predicates in c#?
Can abstract class have constructor in c#?
What exactly happens when we debug and build the program?
What language is arduino?
What is xaml in c#?
What are examples of desktop applications?
What is keywords in c#?
what is IEquatable
What is callback method in c#?
what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }
What are the two uses of a ‘using’ statement in c#?