Search code examples
javaobjectmethodscompiler-errorsfinal

How to rename method with name existing in super class?


I want to rename my function with notify(), and I get compilation error with:

Method 'notify()' cannot override method 'notify()' in
 'java.lang.Object'; overridden method is final.

Can I do this? If not, why not?


Solution

  • You can not override Object.notify() which is final.