1. Home
  2. Computing & Technology
  3. Java

Method Signature

By , About.com Guide

Definition:

A method signature is part of the method declaration. It is the combination of the method name and the parameter list.

The reason for the emphasis on just the method name and parameter list is because of overloading. It's the ability to write methods that have the same name but accept different parameters. The Java compiler is able to discern the difference between the methods through their method signatures.

Examples:

[blockquote shade="yes"] public void setMapReference(int xCoordinate, int yCoordinate)
{
  //method code
} The method signature is setMapReference(int, int) – i.e., the method name and the parameter list of two integers. The Java compiler will let us add another method like so: [blockquote shade="yes"] public void setMapReference(Point position)
{
  //method code
} because it's method signature is different – setMapReference(Point).

Glossary:

# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Explore Java
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

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

  1. Home
  2. Computing & Technology
  3. Java
  4. Java Glossary
  5. M
  6. Definition for the Term: Method Signature>

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

All rights reserved.