Not every method needs to return a value. Some methods just perform an action, like printing output or modifying a file. For those, you use the void return type.
public static void greet(String name) {
System.out.println("Hello, " + name);
}
The word void means this method returns nothing. You call it for its side effect (printing to the console), not for a result. If you try to write int x = greet("Alice");, the compiler will throw an error because greet has nothing to give back.
You can still use return; inside a void method to exit early, but you cannot put a value after it.