Kevin Reid ([info]kpreid) wrote,
@ 2009-09-17 23:46:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:java, programming

What do you call a method, er, header in Java?

What do practicing Java programmers call the part of a method definition that isn't the { body }?

__________/ this bit here \___________
public static void main(String[] args) {
  // not this part
}

A quick search turned up the Java Language Specification, Second Edition calling it a MethodHeader in the grammar, but it doesn't use that term in the text and I want to know what term(s) are used in practice, not solely by language lawyers.

(“Signature” is not correct, as that includes only the method name and parameter types, not modifiers and result type.)




(7 comments) - (Post a new comment)


[info]laurent_atl
2009-09-18 04:08 am UTC (link)
the java programmers i know call it the prototype, i think, but this is probably because they were originally C++ coders.

(Reply to this)


(Anonymous)
2009-09-18 05:51 am UTC (link)
Method header sounds good to me...

(Reply to this)

I used to call it signature
(Anonymous)
2009-09-18 10:26 am UTC (link)
I called it signature, but I guess I shouldn't. So method header it is from now on.

(Reply to this)


[info]bitjuggler
2009-09-18 02:03 pm UTC (link)
As a practical and practicing java programmer, I call it a signature, despite the slight technical inaccuracy: it's close enough to get the point across in conversation that bothering to differentiate is likely not worth the effort -- unless, of course, you're actually talking in a context that requires that differentiation, in which case I would call it the 'full signature' or 'method definition' or somesuch.

(Reply to this)


[info]dougo
2009-09-18 05:20 pm UTC (link)
Declaration, maybe?

(Reply to this)

Unnecessary boilerplate
(Anonymous)
2009-09-19 01:11 pm UTC (link)
Unnecessary boilerplate

(Reply to this)

Signature
(Anonymous)
2009-09-24 09:00 pm UTC (link)
Hey it's Mwn3d from RC. Everywhere I've read and every time I've heard someone talk about it, it's called the signature. Even in IDEs for auto-complete purposes it's called the signature.

(Reply to this)


(7 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…