❮ Java Keywords
Example
public class Main {
static
void
myMethod() {
System.out.println("I just got executed!");
}
public static void main(String[] args) {
myMethod();
}
}Definition and Usage
The void keyword specifies that a method should not have a return value.
Related Pages
Read more about methods in our Java Methods Tutorial .
❮ Java Keywords