Can I access new methods in anonymous inner class with some syntax?

前端 未结 7 2201
深忆病人
深忆病人 2020-12-01 14:48

Is there any Java syntax to access new methods defined within anonymous inner classes from outer class? I know there can be various workarounds, but I wonder if a special sy

相关标签:
7条回答
  • 2020-12-01 15:14

    No, it's imposible. You would need to cast the ActionListener to its real subclass name, but since it's anonymous, it doesn't have a name.

    0 讨论(0)
提交回复
热议问题