This problem reviews Java interfaces from last week. Behold the following interf
ID: 3788949 • Letter: T
Question
This problem reviews Java interfaces from last week. Behold the following interface and class declarations: interface Action Listener {void action Performed (Action Event e); void button Clicked (Action Event e);} class Actor implements Action Listener {public Actor (); public void action Performed (Action Event e); void button Clicked (Action Event e); public void display Banner (String banner);} Answer the following questions: Declare a variable called my Listener to be of type Action Listener and initialize it with an instance of Actor. Can my Listener call action Performed? Why or why not? Can my Listener call display Banner? Why or why not?Explanation / Answer
a.
ActionListener myListener = new Actor();
b.
Yes, myListener can call actionPerformed() method as it is declared in Interface ActionListener.
c.
No, myListener cannot call displayBanner() method as it is not declared in Interface ActionListener.