Language syntax

Java method signature

For ordinary non-generic methods, the name and ordered parameter types identify the signature, not the result type.

Formal Syntax & Structure

java syntaxjava
describe(int)

Working Example

Example Snippetjava
public class Main {    static String describe(int count) { return "Count: " + count; }    static String describe(String label) { return "Label: " + label; }    public static void main(String[] args) {        System.out.println(describe(4));        System.out.println(describe("Pens"));    }}
Java Reference