From 42424f534d679399565c9b98661303a92f4b802a Mon Sep 17 00:00:00 2001 From: joyfaker Date: Fri, 17 Apr 2026 15:39:21 +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