Java - array stuck in for loop -
i'm trying fill array keyboard input, method gets stuck on b = in.nextint();
line, in second last value want input. i'm confused.
public static void main(string[] args) { scanner in=new scanner(system.in); int a_size; int duplicate; system.out.println("enter test size"); a_size = in.nextint(); int [] a_array; a_array = new int[a_size]; int b; (int i= 0; <a_array.length; i++ ){ system.out.println("enter number"); b = in.nextint(); a_array[i] = b; } system.out.println("passed"); }
edit: sorry kind folks. tested code , working fine. simple code , not see wrong it. apologize , agree bundle of sticks. please forgive me.
in.nextint();
is waiting enter keyboard, why stuck
Comments
Post a Comment