DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: methods

Hybrid View

  1. #1
    Join Date
    Apr 2006


    what is method signature ? write a simple program c=a+b by using method signature?

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    You can't ... because a signature is only part of writing a method.

    A method's "signature" is its declaration:

    public int calcC( int a, int b)

    it tells the user that in order to calculate C, you pass the calcC method two int arguments, and the method returns an int value to the calling method.

    If your user's only knowledge of this method is its signature, she knows how to use it. In this way, it is a part of the "interface" to your class. Take a look at the Java API documentation - each class's Javadocs content includes the signatures of the methods, not the body or definition of the methods.

    The programmer still needs to define the method - to write the series of statements which carry out this calcC. This can remain hidden or obscured - the user doesn't need to know the implementation details in order to use the method.
    Last edited by nspils; 04-25-2006 at 07:54 AM.

Similar Threads

  1. Replies: 2
    Last Post: 10-13-2005, 11:16 AM
  2. Comparison methods
    By ericelysia1 in forum Java
    Replies: 34
    Last Post: 05-15-2005, 06:39 PM
  3. Too many methods problem
    By blp in forum Java
    Replies: 2
    Last Post: 05-03-2005, 05:52 AM
  4. How to model "virtual" attributes and methods in UML
    By Larry Hayashi in forum Architecture and Design
    Replies: 2
    Last Post: 05-01-2003, 11:33 AM
  5. Hiding methods from COM
    By Frank Oquendo in forum .NET
    Replies: 0
    Last Post: 07-24-2002, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.