methods


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
    Posts
    3

    methods

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

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    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 08:54 AM.

Similar Threads

  1. Replies: 2
    Last Post: 10-13-2005, 12:16 PM
  2. Comparison methods
    By ericelysia1 in forum Java
    Replies: 34
    Last Post: 05-15-2005, 07:39 PM
  3. Too many methods problem
    By blp in forum Java
    Replies: 2
    Last Post: 05-03-2005, 06: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, 12:33 PM
  5. Hiding methods from COM
    By Frank Oquendo in forum .NET
    Replies: 0
    Last Post: 07-24-2002, 02: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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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