Results 1 to 5 of 5

Thread: java signature question

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    java signature question

    in the following signature

    Code:
    public string getrecord(int key)
    isn't public string part of the signature. i read in an article that the signature comprises of the method name(getrecord) and trhe paramater list((int key))

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: java signature question

    The article is correct, except that the name of the parameter plays no part in the signature. The above method has the signature getrecord(int).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: java signature question

    so the return type (string) & access is not part of the signature?

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: java signature question

    Exactly.

    The signature is the part that decides which function actually gets called from any piece of code. Thus, the containing class is piece of the signature, the function name (obviously), and the parameters. You cannot overload on return type or access type. I'm not sure if static or not is considered, though. I don't think it is.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: java signature question

    pearls of wisdom, now i understand what a signature really is

    thanks cornedbee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width