A Java method is a set of statements to perform a task. A method is placed in a class.
Signatures of methods: The name of the method, return type and the number of parameters comprise the method signature. A method can have the following elements in its signature: – Access specifier – public, private, protected, etc. (Not mandatory) – Access modifier – static, synchronized, etc. (Not mandatory) – Return type – void, int, String, etc. (Mandatory) – Method name – show() (Mandatory) – With or without parameters – (int number, String name); (parenthesis are mandatory)
Example: filter_none brightness_4 class Test { void fun1() {} public double fun2(double x) {} public static void fun3() {} public static void fun4(String x) {} }