From 5bb0c182e988ceeec833d0199450dcf04400f490 Mon Sep 17 00:00:00 2001 From: lzy <3479370893@qq.com> Date: Sat, 27 Sep 2025 12:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96JavaS=E8=BF=9B=E4=B8=80?= =?UTF-8?q?=E6=AD=A5=E5=AE=8C=E5=96=84=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/META-INF/MANIFEST.MF | 3 +++ src/com/mathpaper/user/Account.java | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 src/META-INF/MANIFEST.MF diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8254642 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: com.mathpaper.main.Main + diff --git a/src/com/mathpaper/user/Account.java b/src/com/mathpaper/user/Account.java index 6c5cd7a..b765a13 100644 --- a/src/com/mathpaper/user/Account.java +++ b/src/com/mathpaper/user/Account.java @@ -1,5 +1,7 @@ package com.mathpaper.user; +import java.util.Set; + public class Account { private String username; private String password; @@ -7,6 +9,9 @@ public class Account { // 构造方法 public Account(String username, String password, String type) { + if (!Set.of("小学", "初中", "高中").contains(type)) { + throw new IllegalArgumentException("无效的学段类型"); + } this.username = username; this.password = password; this.type = type;