Yes, multiple inheritances are not allowed in C#. In order to fulfill such a need Interfaces are used.
One parent class can have many child classes inherited from its parent class. But C# will not allow a child class to inherit from many parent classes. Because one child can't have many parents, this is a real world scenario. C# is well attuned to real world scenario!
Agree with Maha. However apart from method overloading , In object oriented programming we uses interface known as polymorphic interface to achieve the same with other types(classes).
Using the same method name to indicate different implementations is called polymorphism. The word polymorphism means "many forms"; it means many forms of action take place even though you use the same method name to describe the action. In other words, there are many forms of the same method depending on the object associated with the word.
For example if you take OPEN word that takes many form; OPEN a bank account, OPEN a door or OPEN a bottle. Same word but different action that is polymorphism.
polymorphism basically means multiple forms !! it is a way to use a single thing in many forms by saying things i mean to say like variable, objects funtions and all.. 01
Syed ShanuPosted Apr 13, 2015, 12:43 AM
Jignesh TrivediPosted Apr 13, 2015, 12:23 AM
Hi,
Please refer my article
http://www.c-sharpcorner.com/UploadFile/ff2f08/understanding-polymorphism-in-C-Sharp/
MahaPosted Apr 12, 2015, 8:03 AM
One parent class can have many child classes inherited from its parent class. But C# will not allow a child class to inherit from many parent classes. Because one child can't have many parents, this is a real world scenario. C# is well attuned to real world scenario!
Riddhi ValechaPosted Apr 12, 2015, 7:28 AM
So.. We can do multiple inheritance in c# using interfaces ?? Is this the only way ??
Can you please give an example of multiple inheritance ??
Anupam SinghPosted Apr 12, 2015, 7:00 AM
Riddhi ValechaPosted Apr 12, 2015, 6:50 AM
Is there anything like operator overloading in c# ?? Or this was only in C++ ??
Anupam SinghPosted Apr 12, 2015, 4:11 AM
However apart from method overloading , In object oriented programming we uses interface known as polymorphic interface to achieve the same with other types(classes).
MahaPosted Apr 11, 2015, 9:31 AM
For example if you take OPEN word that takes many form; OPEN a bank account, OPEN a door or OPEN a bottle. Same word but different action that is polymorphism.
Akhil GargPosted Apr 11, 2015, 5:15 AM
https://msdn.microsoft.com/en-us/library/ms173152.aspx
Laxman PrajapatiPosted Apr 11, 2015, 4:22 AM
Khargesh RajputPosted Apr 11, 2015, 4:11 AM
http://www.c-sharpcorner.com/UploadFile/5d065a/polymorphism-in-C-Sharp/
Nitin GaurPosted Apr 11, 2015, 3:27 AM
it is a way to use a single thing in many forms by saying things i mean to say like variable, objects funtions and all..
01