@override annotation

后端 未结 6 1079
别跟我提以往
别跟我提以往 2021-01-17 11:57

Can anyone tell me if this code:

public class OvTester {
    @Override
    public int hashCode() {
        return toString().hashCode();
    }
}
6条回答
  •  逝去的感伤
    2021-01-17 12:27

    No, it will only mean that the hashCode() method is being overridden. The compiler will check at compile time that hashCode() really is a method (with that signature) that is being overridden.

提交回复
热议问题