i want use this function how can i do it?
thx for help
but i need the int[] numbersprivate static int[] print (int x) {
this is my code
package homeworks; import java.util.Scanner; public class ex1{ public static void main(String[]args) { Scanner scan = new Scanner(System.in); int x = scanx(scan); print(x); scan.close(); } public static int scanx (Scanner scan) { System.out.println("ENTER A NUMBER"); int r = scan.nextInt(); while(r<=0) { r = scan.nextInt(); } return r; } private static int[] print (int x) { int[] arr = new int[x]; for(int i=0;i<x;i++) { arr[i]=(int)(Math.random()*1000); System.out.print(arr[i]); System.out.print(" "); }return arr; } }