How to use a void method in Java?
package tombtombbekerekit; import java.util.Scanner; public class TombTombbeKerekit { public static int round(int osszeg) { int last_Digit = osszeg % 10; if(last_Digit < 3) return osszeg - last_Digit; else if(last_Digit > 7) return osszeg + (10 - last_Digit); else return osszeg - (last_Digit) + 5; } public static void roundSelf(int [] numbers) { int [] array = numbers; for (int i = 0; i < array.length; i++) return; } public static int [] roundNew(int [] numbers) { int [] newArray = numbers; for (int i = 0; i < newArray.length; i++) { newArray[i] = round(newArray[i]); } return newArray; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Kérem az összegek számát: "); int size = sc.nextInt(); System.out.println("Kérem az összegeket: "); int [] array = new int[size]; for (int i = 0; i < array.length; i ++) { array[i] = sc.nextInt(); } int [] ujTomb = roundNew(array); System.out.println("Kerekítve: "); for (int i = 0; i < ujTomb.length; i++) System.out.println(ujTomb[i]); } } I wrote this code to round the elements of an array by a custom rounding rule. There are 3 methods, round is used to round a number by a custom rule, roundSelf is for modifying the input array and roundNew for making a new array with the same size of the input array and the program returns to this method. The problem is I don't understand what is the purpose of the roundSelf method because it's void and haven't got a return value so I can't call it from the main and can't call from roundNew method. Are there any suggestion to call it from the main program?