polygenelubricants
polygenelubricants

Reputation: 383966

Naming convention when casually referring to methods in Java

Is there a Java convention to refer to methods, static and otherwise, any specific one or the whole overload, etc?

e.g.

Is there an authoritative recommendation on how to clearly refer to these things?

Upvotes: 4

Views: 389

Answers (2)

BalusC
BalusC

Reputation: 1109512

Depends on the context where you'd like to refer them. I myself tend to use Javadoc-style links everywhere (in Javadocs, my blog, forum posts, etcetera) and prefer to make them clickable as well, although admittely not consistently with method arguments when used outside Javadocs (I am a bit too lazy in this, Eclipse offers autocompletion of @link tags ;) ). With regard to authoritative recommendations, there's as far as I know only the Javadoc linking recommendation.

Upvotes: 1

sepp2k
sepp2k

Reputation: 370425

Using Class.methodName to refer to all overloads and Class.methodName(type) to refer to a specific overload is indeed the convention (as recommended by sun in this style guide for javadocs). However there is no convention to distinguish between static and non-static methods (though aString.split would make sense).

Upvotes: 7

Related Questions