[Java] [Java] method

less than 1 minute read

Method definition

public static void method name () {processing;}

public static void hello() {
  System.out.println("hello world");
}

Overload

Available by changing the type and number of arguments
Same method name but different arguments

public static void hello() {
  System.out.println("hello world");
}

public static void hello(String name) {
  System.out.println("Hello" + name + "Mr.");
}

Tags:

Updated: