Starlit Daily

📚 › Java

4. Methods

Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.

A method is a named block of code inside a class. Declare the return type, the name and the parameter types. static methods can be called without creating an object.

Ver ejemplo

static int twice(int x) {
  return x * 2;
}

← Volver al curso