优化JavaS进一步完善细节

develop
lzy 6 days ago
parent 9b6837aad5
commit 5bb0c182e9

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.mathpaper.main.Main

@ -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;

Loading…
Cancel
Save