Results 1 to 7 of 7

Thread: Function overloading example

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Answers
    3

    Function overloading example

    I want to know whether the below example is function overloading,

    int display(int,int);
    char display(char,char);


  2. #2
    Contributing Member
    Join Date
    Feb 2007
    Answers
    47

    Re: Function overloading example

    Yes..
    The above example is an example of overloading.
    But in java,we will call it as method overloading and in C++,it is function overloading..

    Thanks
    Neelima


  3. #3
    Junior Member
    Join Date
    Apr 2007
    Answers
    3

    Re: Function overloading example

    Quote Originally Posted by neelim View Post
    Yes..
    The above example is an example of overloading.
    But in java,we will call it as method overloading and in C++,it is function overloading..

    Thanks
    Neelima
    Thanks neelima


  4. #4
    Junior Member
    Join Date
    Dec 2006
    Answers
    9

    Post Re: Function overloading example

    Yes...of course its a function overloading...


  5. #5
    Junior Member
    Join Date
    May 2007
    Answers
    10

    Re: Function overloading example

    ya, it's method overloading

    same method name difference in parameters is methodoverloading

    function overloading in c++ we call it as a method overloading in java


  6. #6
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Re: Function overloading example

    Quote Originally Posted by vicky19772003 View Post
    I want to know whether the below example is function overloading,

    int display(int,int);
    char display(char,char);
    int display(int,int);
    Char display(int,int);
    char display(char,char);
    int display(char,char);
    char display(int,char);
    char display(char,int); etc.

    all are correct and can exist.

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  7. #7
    Junior Member
    Join Date
    May 2007
    Answers
    3

    Re: Function overloading example

    Quote Originally Posted by vicky19772003 View Post
    I want to know whether the below example is function overloading,

    int display(int,int);
    char display(char,char);
    This is an eg. of function overloadin since the function names are same & arguments are different.The return types may or may not be the same.Don't get confused with function overriding since that is related with inheritance.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact