An unknown incidental problem (Java)

zhaozj2021-02-16  54

ActionListener A1 = New ActionListener ()

{

Public Void ActionPerformed (ActionEvent E) {

String name =

(Jbutton) E.Getsource ()). GetText ();

TXT.SETTEXT (NAME);

}

}

This is a Button's ActionListener, which has used an inner hidden class. I still have another question, why do new ActionListener () can? ? ? ActionListener is an interface. . . . Can I call Interface's constructrou? ? ? ?

转载请注明原文地址:https://www.9cbs.com/read-18100.html

New Post(0)