Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Polymorphism in OOPS within the OOPS forums, part of the Software Development category; Can we implement polymorphism in asp.net...
|
|||||||
|
|||
|
Re: Polymorphism in OOPS
Hi,
Yes. U can implement polymorphism in asp.net Just look at the example..... 1)Compile Time Polymorphism Method Overloading class A1 { void hello() { Console.WriteLine(“Hello”); } void hello(string s) { Console.WriteLine(“Hello {0}”,s); } } 2)Run Time Polymorphism Method Overriding Class parent { virtual void hello() { Console.WriteLine(“Hello from Parent”); } } Class child : parent { override void hello() { Console.WriteLine(“Hello from Child”); } } static void main() { parent objParent = new child(); objParent.hello(); } //Output Hello from Child. If any query let me know..... Thanks & Regards, Riju |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Polymorphism | stylish16 | OOPS | 6 | 09-02-2009 05:50 AM |
| Polymorphism | Martina | VB.NET | 6 | 01-01-2009 03:01 AM |
| Polymorphism | kalayama | OOPS | 10 | 10-02-2008 01:49 AM |
| Dynamic Polymorphism in C | mkannanmca86 | C and C++ | 1 | 05-26-2008 04:30 AM |
| Polymorphism......... | Sampath_Java | Java | 4 | 09-12-2007 01:50 AM |