Results 1 to 4 of 4

Thread: Function overloading with polymorphism

  1. #1
    Join Date
    Apr 2009
    Posts
    34

    Function overloading with polymorphism

    I use a class B inherits from class A. The class A contains a function call an integer parameter. I want to override this method in Class B, making a virtual void Do loop (double f). Is that possible, if know then tell me the Difference between function overloading and polymorphism?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Function overloading with polymorphism

    Polymorphism is simply the ability to have many different methods (Or functions but the actual difference is depend on the parameters passed to the function. The difference between polymorphism and method overloading is in the time when the actual method to execute is determined.

  3. #3
    Join Date
    Jan 2009
    Posts
    199

    Re: Function overloading with polymorphism

    Polymorphism allows a single definition for multiple data types. Overloading is a specific case of polymorphism where some operators have different implementations depending on the types of arguments.Polymorphism is not the same as method overloading or method overriding. Polymorphism is only concerned with the application of specific implementations to an interface or a more generic base class.

  4. #4
    Join Date
    Dec 2008
    Posts
    177

    Re: Function overloading with polymorphism

    You must put your virtual function to Do loop in your class B? If you inherit class B concept of polymorphism breaks. Method overloading is one form or one facet of polymorphism, but it is not the core of polymorphism.

Similar Threads

  1. What does polymorphism mean in OOP?
    By Khan Baba in forum Software Development
    Replies: 5
    Last Post: 06-02-2010, 02:14 PM
  2. Runtime polymorphism Vs Compile time polymorphism
    By Owen Fernandes in forum Software Development
    Replies: 4
    Last Post: 03-02-2010, 11:06 AM
  3. Polymorphism VS Inheritance
    By Taylor D in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 10:12 AM
  4. Error in function overloading
    By CitricAcid in forum Software Development
    Replies: 3
    Last Post: 06-05-2009, 10:50 AM
  5. Polymorphism in SQL database
    By cobra2008 in forum Software Development
    Replies: 2
    Last Post: 04-04-2009, 09:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,411,990.67262 seconds with 16 queries