读书人

在继承中的错误

发布时间: 2012-07-26 12:01:08 作者: rapoo

在继承中的异常

在继承中的异常
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 */
  
  

读书人网 >其他相关

热点推荐