diff --git a/BadArray.java b/BadArray.java new file mode 100644 index 0000000..6a0dada --- /dev/null +++ b/BadArray.java @@ -0,0 +1,14 @@ +public class BadArray { + private static int[] store = new int[4]; + + public static void putData(int pos, int num) { + if (pos < 0) { + return; + } + store[pos] = num; + } + + public static void main(String[] args) { + putData(5, 100); + } +} \ No newline at end of file