Today , research Interface, and get the following conclusion:
1
public
?interface?Inface
{
2
?????????
public
?
void
?a()?
throws
?Exception;
3
?????????
public
?
void
?b()?;
4
}



2

3

4

A)
public?class Test implements Inface{
?????? public void a(){
?????? }
???????public void b(){
?????? }
}
correct!
B)
public?class Test implements Inface{
?????? public void a() throws Exception{
?????? }
???????public void b(){
?????? }
}
correct!
C)
public?class Test implements Inface{
?????? public void a() throws Exception{
?????? }
???????public void b()throws Exception{
?????? }
}
Wrong!
接口方法 a) throws Exception, 說明實現他的類可以不處理Exception, 把Exception 向上拋, 也可以處理Exception,therefore A) is ok.B) is ok also.? But C) method b() in Test class don't have to catch Exception, but its interface Inface define b() must handle Exception if have Exception, so C) is wrong.