桥后总结 一

 

一:

The method getByName(String) of type UserServiceImpl must override or implement a supertype method

翻译:UserServiceImpl类型的getByName(String)方法必须覆盖或实现超类型方法

 

小白我来解释一下,出现这个错误警告是因为没有实现父类的方法

 

解决的方法

  1.刚刚的UserServiceI接口忘记保存了

  2.接口中的方法没有完全实现

二:

@Override  (它的理解)

Indicates that a method declaration is intended to override a method declaration in a supertype. If a method is annotated with this annotation type compilers are required to generate an error message unless at least one of the following conditions hold: The method does override or implement a method declared in a supertype. The method has a signature that is override-equivalent to that of any public method declared in Object.

翻译:

指示方法声明旨在重写超类型中的方法声明。如果一个方法是用这种注释类型编译器注释的,则需要生成错误消息,除非至少满足下列条件之一:

 

该方法确实重写或实现超类型中声明的方法。

该方法具有与Object中声明的任何公共方法相同的覆盖签名

 

 

 

 

 

 

posted @ 2020-02-01 18:04  小树木  阅读(165)  评论(0编辑  收藏  举报