File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes what is method signatur in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is method signatur in java" Watch "what is method signatur in java" New topic

what is method signatur in java

kiran kumar

Joined: Feb 07, 2005
Posts: 29
what is method signature in java?
method signature consists of different arguments and return type also?
Priya Jothi
Ranch Hand

Joined: Jul 13, 2004
Posts: 168

Method signature in java is simply a method name followed by argument list(if any).This does not include the return type.

For example consider the method

public void methodA(int a,int b);

method signature for the above method is <b>methodA(a,b)</b>.
assuming data type of a & b is int or a narrower type convertible to an int.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

the method signiature actually includes the TYPES of the arguemnts passed...

methodA(int a, int b)

this allows the compiler to recognize the difference between that and

methodA(String a, int b)
[ June 24, 2005: Message edited by: fred rosenberger ]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joel McNary

Joined: Aug 20, 2001
Posts: 1824


I note that you have recently changed your display name. However, your new name does not comply with the JavaRanch Naming Policy. Please Change your display name to comply. (We are looking for a first and last name; preferably your own, but one that is at least not obviously fictitious.)

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
I agree. Here's the link:
subject: what is method signatur in java
It's not a secret anymore!