I can not understand what's wrong. The do\while with the setSize label setSize never executed, which is why the array is not initialized. The do loop should run at least once, right?
int bound; int array[]; setSize: do { System.out.println("ΠΠ²Π΅Π΄ΠΈΡΠ΅ ΠΆΠ΅Π»Π°Π΅ΠΌΡΡ Π΄Π»ΠΈΠ½Π½Ρ Π΄Π»Ρ Π½ΠΎΠ²ΠΎΠ³ΠΎ ΠΌΠ°ΡΡΠΈΠ²Π°"); bound = getInt(); if (bound <= 0) { System.out.println("ΠΠ»ΠΈΠ½Π½Π° ΠΌΠ°ΡΡΠΈΠ²Π° Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΎΡΡΠΈΡΠ°ΡΠ΅Π»ΡΠ½ΠΎΠΉ ΠΈΠ»ΠΈ Π½ΡΠ»Π΅Π²ΠΎΠΉ!"); continue setSize; } array = new int[bound]; } while (bound <= 0); System.out.println("Π‘ΠΎΠ·Π΄Π°Π½ ΠΌΠ°ΡΡΠΈΠ² array Π΄Π»ΠΈΠ½Π½ΠΎΠΉ " + array.length + " ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ²!"); for (int i = 0; i < array.length; i++) { System.out.println("ΠΠ²Π΅Π΄ΠΈΡΠ΅ ΡΠΈΡΠ»ΠΎ Π΄Π»Ρ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ° ΠΌΠ°ΡΡΠΈΠ²Π° Ρ ΠΈΠ½Π΄Π΅ΠΊΡΠΎΠΌ: " + i); array[i] = getInt(); }
int array[];followingint array[] = {};or change the logic. - KoVadimcontinue;instead ofcontinue setSize;(if you had nested loops, for example, and you would need to jump from the inner one to the next iteration of the outer one, then yes) - StateItPrimitivearraywill always be initialized), and you run the old version, in which there is no loop. If you are sure that you are right, provide the entire class code, and indicate how you compile and run it. - zRrr