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

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -