Java – implementation is also overridden

I added spring security to my application and encountered a problem My userdetails implements org springframework. security. core. userdetails. Userdetails, but also extends my user entity class Both have a GetPassword () method. The method of the spring security interface returns a string, and mine returns a byte array because the password is encrypted

I want my method to implement the interface instead of covering my entity class, but NetBeans keep giving errors and the return type is invalid I want to avoid renaming my GetPassword () method to solve this problem

Is there any way to tell the compiler to implement the methods of the interface instead of overriding the superclass?

thank you

Solution

Overloading does not consider the return type, so basically you can't really do this I just want to rename my implementation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>