Can I annotate a member inherited from a superclass?

前端 未结 4 692
一向
一向 2021-02-13 20:02

If I have a class such as:

class Person {
  private String name;
  ...constructor, getters, setters, equals, hashcode, tostring...
}

Can I subc

4条回答
  •  猫巷女王i
    2021-02-13 20:17

    No - you will get two different fields. The annotated name field in Employee will be hiding the name field in the Person class. Person.name will not be annotated.

提交回复
热议问题