Home > Back-end >  An anonymous inner class not heavy why not an error?
An anonymous inner class not heavy why not an error?

Time:10-08



Why the error can also perform ah, to solve.

CodePudding user response:

What is wrong? You show method is not abstract method, can not rewrite,

CodePudding user response:

reference 1st floor qybao response:
what wrong? You show method is not abstract method, can not rewrite,

But rewriting is not need parameters inconsistent

CodePudding user response:

refer to the second floor along the dream way response:
but rewriting is not need any parameters inconsistent


Your understanding is flawed, although rewriting and overloading are object-oriented polymorphism features, but it is not the same as the concept of
In the same class and its subclasses, different parameter with the same method, called "reload"
A subclass with the same name method overrides the superclass method, known as the "rewriting"

CodePudding user response:

Overloading parameters are needed, rewrite doesn't need
Pay attention to the difference overloading and rewrite
  • Related