Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote