Java Java method basis ---

The basic method of definition:

public static void method name () {
    Method member
  }

  • Naming method names and variables, using a small hump.
  • Procedure: namely braces which can contain any statement.

Precautions:

  • 1. The method defined order does not matter.
  • 2. The method defined comprises not produce a nested relationship.
  • 3. Once the method is defined, it will not be executed. If you want to execute, be sure to call the method of [].

How to call a method, format:

  • Method name ();

Guess you like

Origin www.cnblogs.com/hoganhome/p/11481648.html