You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MVC/DuplicateStudentException.java

23 lines
522 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.studentmanagement.exception;
/**
* 重复学生异常当尝试添加ID已存在的学生时抛出
*/
public class DuplicateStudentException extends Exception {
/**
* 构造函数
* @param message 异常信息
*/
public DuplicateStudentException(String message) {
super(message);
}
/**
* 构造函数带学生ID
* @param id 学生ID
*/
public DuplicateStudentException(int id) {
super("学生ID " + id + " 已存在");
}
}