Overloading means two methods share a name and differ in the parameter list. The compiler picks the version that matches the arguments you pass. The return type alone is not enough to tell them apart.
Use overloading when the action is the same and only the input shape changes, such as printing an int or printing a String. If the actions differ, give them different names.
Example
The int call uses the first method. The string call uses the second. The printed prefix shows which one ran.
public class Show {
static void line(int n) { System.out.println("n=" + n); }
static void line(String text) { System.out.println("t=" + text); }
public static void main(String[] args) {
line(4);
line("Java");
}
}