62,614
社区成员
发帖
与我相关
我的任务
分享
public class ShortStringReader extends Console {
private final static int MAX = 10;
public ShortStringReader() throws LongStringException{
// TODO Auto-generated constructor stub
if(super.readString().length() <= MAX)
return super.readString();
else
throw new LongStringException("String to long. MAX:" + MAX);
}
}
public class Main {
static void Quotient(int n, int d){// throws ArithmeticException {
try {
System.out.println(n/d);
} catch (ArithmeticException e) {
System.out.println(e);
}
}
public static void main(String[] args) {
int numer = 10;
int denom = 0;
Quotient(numer, denom);
}
}