📄 boundsexception.java
字号:
package exception;
/**
* 这个类主要用于处理在修改taxtable过程中出现的输入范围不匹配或者输入不正确
* @author ZiHi
*
*/
public class BoundsException extends Exception{
/**
* 这里主要处理用户输入的level不在要求的范围内
* @param low level下限
* @param high level上限
*/
public BoundsException(int low,int high)
{
System.out.println("Wrong level input");
System.out.println("Please input the number between "+low+" "+high+"!");
}
/**
* 这里主要处理用户输入的rate不在要求的范围内
* @param low rate上限
* @param high rate下限
*/
public BoundsException(double low,double high)
{
System.out.println("Wrong rate input");
System.out.println("Please input the number between "+low+" "+high+"!");
}
/**
* 这里主要处理用户输入的level已经存在
* @param int q 输入的错误level
*/
public BoundsException(int q)
{
System.out.println("The level "+q+" is already existed!");
}
/**
* 这里主要处理用户输入的参数已经存在并且提示用户只能修改它而不能进行橧删操作
* @param String type
*/
public BoundsException(String type)
{
if(type=="level"){
System.out.println("Bad level input! You can just set it but add.");
}
if(type=="rank"){
System.out.println("There no rank you called!");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -