Solved

Assume That the TimerListener Class Implements the ActionListener Interface

Question 56

Multiple Choice

Assume that the TimerListener class implements the ActionListener interface. If the actionPerformed method in TimerListener needs to be executed every second, what statement should be used to complete the following code segment? ActionListener listener = new TimerListener() ;
_________________________________ // missing statement
Timer.start() ;


A) Timer timer = new Timer(listener) ;
B) Timer timer = new Timer(1, listener) ;
C) Timer timer = new Timer(100, listener) ;
D) Timer timer = new Timer(1000, listener) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions