If Problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If Problem

if (StartFunktion.Sitzplatz[0] != null == true) { Draw.St0 = 1; System.out.println(List.get(0) + ": " + StartFunktion.Sitzplatz[0]); } if (StartFunktion.Sitzplatz[1] != null == true) { Draw.St1 = 1; System.out.println(List.get(1) + ": " + StartFunktion.Sitzplatz[1]); } if (StartFunktion.Sitzplatz[2] != null == true) { Draw.St2 = 1; System.out.println(List.get(2) + ": " + StartFunktion.Sitzplatz[2]); } if (StartFunktion.Sitzplatz[3] != null == true) { Draw.St3 = 1; System.out.println(List.get(3) + ": " + StartFunktion.Sitzplatz[3]); } if (StartFunktion.Sitzplatz[4] != null == true) { Draw.St4 = 1; System.out.println(List.get(4) + ": " + StartFunktion.Sitzplatz[4]); } My Problem is that when my Array is only 3 Long, there would be an error. How can I do it that the if Statement stops, when the Array is only 4 Long.

29th Apr 2018, 1:50 PM
Stefan Mueller
Stefan Mueller - avatar
1 Answer
+ 5
If possible, please provide a Minimal, Complete, and Verifiable code @ Code Playground so we can help you to take a look on the code. 😉
30th Apr 2018, 12:05 AM
Zephyr Koo
Zephyr Koo - avatar