1. Home
  2. Computing & Technology
  3. Java
photo of Paul Leahy
Paul's Java Blog

By Paul Leahy, About.com Guide to Java

Java Term of the Week: Method Signature

Saturday November 1, 2008

It's time to look at the humble method signature. It is part of the method declaration and is simply the combination of the method name and parameter list. For example, consider this method declaration:

public void setMapReference(int xCoordinate, int yCoordinate)
{
  //method code
}

It's method signature is setMapReference(int, int) – the method name and the parameter list of two integers.

An object's constructor method is a good example of a time when you might want to employ multiple method signatures. There could be a couple of ways you want to create a new object based on the parameters you pass to it. The reason the compiler doesn't complain is it can distinguish which method to use by the method signature.

Comments
November 1, 2008 at 2:20 pm
(1) Jose Ayerdis says:

Each method has it owned signature on Java, is fancy way that allows us to do “Overloading Method”. right?

November 1, 2008 at 7:36 pm
(2) Paul Leahy says:

yep, that’s exactly right.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss
Community Forum
Explore Java
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Java

©2009 About.com, a part of The New York Times Company.

All rights reserved.