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
What is helper method in c#?
what are pointer types in c#
Can you declare a field readonly?
Does c# have primitives?
Is equal in c#?
what is IDisposal interface,IComparable,IEquatable,IFormatable
What is a function c#?
Can arraylist store different data types in c#?
Why do we need constructor?
How can you reference current thread of the method ?
Why do I get a syntax error when trying to declare a variable called checked?
What are the main reasons to use c# language?
What is difference between first and firstordefault?
Explain the types of comments in c#?
Why is aws serverless?