• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is method signatur in java

 
kiran kumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
what is method signature in java?
method signature consists of different arguments and return type also?
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Thanks,
Priya.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12186
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kiran:

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.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic