Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD

Part 23 - C# Tutorial - Polymorphism


Part 23 - C# Tutorial - Polymorphism


7 comments:

  1. Hello Venkat,

    I'm bit confused between new(shadow) and override keyword.Kindly explain what's the difference and when to use these.

    Thanks,
    Rohan

    ReplyDelete
    Replies
    1. Got my query resolved...
      The answer is in your next video.
      Thanks...

      Delete
  2. Hi Sir,

    There is a confusion. I have heard that there are two type of polymorphim.

    1.Compile Time
    2.Runtime

    I think the above video explains the runtime polymorphism.
    Kindly explain compile time polymorphism.

    ReplyDelete
  3. I think this is simplier way to explain polymorphism:

    Employee FTE = new FullTimeEmployee();
    FTE.PrintFullName();

    Employee E = new Employee();
    E.PrintFullName();


    ReplyDelete
  4. what are the uses of static key word and how should i use ?

    ReplyDelete
  5. Hi Venkat,

    I have one confusion about run time polymorphism. How one can say that overriding of method happens at run time and overloading at compile time.

    Thanks
    Rakesh

    ReplyDelete
  6. contd.

    BaseClass bObj = New ChildClass()
    bObj.commonMethodName

    1> If Base method 'virtual'(Or 'override' in case on multi level inheritance) and child method 'override' -> child method executes
    2> If Base method is not 'virtual'(Or 'override' in case on multi level inheritance) and child method 'new'(optional, vs prompt) -> base method executes (Also called method hiding)

    ReplyDelete

If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.