From e22d7ca2baa56d065d9b63070106fda69dba58cc Mon Sep 17 00:00:00 2001 From: joyfaker Date: Sat, 18 Apr 2026 15:36:31 +0800 Subject: [PATCH] Add files via upload --- BadArray.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 BadArray.java 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