what is the difference between partial class and inheritance?

Posted by Rajendra.prasad under ASP.NET on 5/8/2011 | Points: 10 | Views : 7944 | Status : [Member] | Replies : 6
Hi,
what is the difference between partial class and inheritance?

Regards,
Rajendra




Responses

Posted by: Lokesh76 on: 5/8/2011 [Member] Starter | Points: 25

Up
0
Down
Partial classes : Within namespace class name can not be duplicate but at the time of development if its require to work multiple developer on single class inside same namespace then we can achieve the same with the help of partial keyword.

So we can have same name classes inside a namespace if we use partial keyword and complier pick all these and make a single final class with exact name.
namespace test
{
partial class person
{
//Developer 1 working on this
}
}
namespace test
{
partial class person
{
//Developer 2 working on this
}
}
compiler compile both and result a single person class.

Inheritance: We have class with some functionality and want to use that class functionality in another class then we use Inheritance. Inheritance allows us to use existing class functionality in derived classes.


Thanks
Lokesh Kumar

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Tijut2k on: 5/9/2011 [Member] Starter | Points: 25

Up
0
Down
Goto this LInk

http://addressof.com/blog/archive/2006/02/16/Inheritance-vs.-Partial.aspx

Best Regard's
Tiju Thankachan

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajendra.prasad on: 5/10/2011 [Member] Starter | Points: 25

Up
0
Down
Thanks for your reply

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 5/10/2011 [Member] Bronze | Points: 25
Posted by: Lakn2 on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
inheritance and partialclass are equallent to overloading and ovverriding (but not same).in inheritance we are acquiring properties,methods from base class to derived class,but in the case of partical class same purpose but we are using same method names but different classes by preceding partial keyword.

Thanks&Regards
LakshmiNarayana Nalluri.

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 5/19/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Refer this,

http://addressof.com/blog/archive/2006/02/16/Inheritance-vs.-Partial.aspx

Regards,
Susan

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response