From 99751d58c95861787baa2c2d7df8d74f05abcb91 Mon Sep 17 00:00:00 2001 From: joyfaker Date: Fri, 7 Aug 2026 14:37:46 +0800 Subject: [PATCH] cccc Signed-off-by: joyfaker --- BadArray.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 BadArray.java diff --git a/BadArray.java b/BadArray.java new file mode 100644 index 0000000000..ef74d37953 --- /dev/null +++ b/BadArray.java @@ -0,0 +1,20 @@ +/** +* +* 一个数组的算法 +* +**/ + +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