首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

在继承中的错误

2012-07-26 
在继承中的异常在继承中的异常 2011年09月01日  public interface ExceptionInterface { void exceptioned

在继承中的异常

在继承中的异常
2011年09月01日
  public interface ExceptionInterface { void exceptionedMethod()throws Exception; } public abstract class ExceptionAbstractClass implements ExceptionInterface{ public void exceptionedMethod() throws/* Exception,*/UnsupportedOperationException { } } public class ExceptionClass extends ExceptionAbstractClass { public void exceptionedMethod() throws Exception { } }
  最后一个会报错。
  PS:UnsupportedOperationException : /** * Thrown to indicate that the requested operation is not supported. * * This class is a member of the *  * Java Collections Framework. * * @author Josh Bloch * @version 1.15, 01/23/03 * @since 1.2 */
  
  

热点排行