Hello everyone, I realise that i have written in the wrong section, feel free to move my post into the correct section..
Here is my code below..
import java.util.Scanner; public class test{ public static void main(String args[]) { Scanner input = new Scanner(System.in); int array[] = new int [5]; System.out.println("Enter a number"); name(array); } public static void name(int y[]) { Scanner input = new Scanner(System.in); for (int i=0;i<y.length;i++) { y[i] = input.nextInt(); System.out.println(y[i]); } } }
What i want to do is increment my variable' i' without the for loop, because i need ask additional questions afterwards...Thanks!