public class trying
{
public int output(int c) throws NegativeNumberException
{
return c; }
}
这段代码编译后显示:
1错误
trying.java:5: 找不到符号
符号:类NegativeNumberException
位置:类trying
public int output(int c) throws NegativeNumberException
^
{
public int output(int c) throws NegativeNumberException
{
return c; }
}
这段代码编译后显示:
1错误
trying.java:5: 找不到符号
符号:类NegativeNumberException
位置:类trying
public int output(int c) throws NegativeNumberException
^
public int output(int c) throws NegativeNumberException
{
if (c < 0) throw NegativeNumberException();
return c;}
}