Answer Posted / shivacharan
Reason1: In C# Multiple inheritence concept will be
implemented by Interfaces.
Reason2: When multiple ppl are working on one sigle
project, if they need to use some common functionality (for
example initializing the variables for thier modules)
instead of writing their own function name (like init,
initialize, setup etc etc) if we can write one single
function name (lets say initialize) then this function can
be implemented by any user who derives. That's it.
public interface IInitialize
{
void InitializeVar();
}
public classs Box:IInitialize
{
void InitializeVar()
{
//initializion of variables goes here
}
public classs Rectangle:IInitialize
{
void InitializeVar()
{
//initializion of variables goes here
}
this wil avoid all the confusion
| Is This Answer Correct ? | 23 Yes | 1 No |
Post New Answer View All Answers
Difference between directcast and ctype.
When should I use static in C#?
In object oriented programming, how would you describe encapsulation in c#?
1. Describe page life cycle?
What are the benefits of using generics in c#?
Contrast between an interface and abstract class?
Is python easier than c#?
How many destructors can a class have?
Is concurrent queue thread safe?
Describe two uses of the “using” statement during the operation of c#?
Does c# have primitives?
State the top.NET class that everything is derived from?
Structs are largely redundant in c++. Why does c# have them?
Is list ienumerable c#?
Give an example of removing an element from the queue?