我只是想知道如何在内部类中实现接口(interface)。我必须创建一个名为 tConvertMethods 的接口(interface),然后在内部类中实现它。
You will be doing the event-handling operations using an inner class, have the inner class implement tConvertMethods interface as well as having it implement ActionListener inferface.
最佳答案
您可以在 Java 中实现多个接口(interface)。
如果 ButtonHandler
是您的内部类。
private class ButtonHandler implements ActionListener, tConvertMethods{
// Your code here
}
关于java - 在内部类中实现接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18221423/