File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes events Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "events" Watch "events" New topic
Author

events

Aru
Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Hi Again,
This one is confusing..it is from IBM mock test...
can anyone help ?

Based on the code below assume A1 & A2 implement ActionListener interface.
TextField tf = new TextField("This is a test");
ActionListener ac1 = new A1();
ActionListener ac2 = new A2();
tf.addActionListener(ac1);
tf.addActionListener(ac2);
a. The enableEvents() method must be registered to the TextField()
b. This code compiles & runs successfully.
c. Lines 2 & 3 generate errors when compiled.
d. This code will not run without error.
Thx in Advance
Aruna
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Code compiles and runs successfully, if U have RHE then u will find the similar question and the explanation over there.
Hope this helps
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5781
Aruna,
May be you can tell us what is confusing about this question.
Ajith


Open Group Certified Master IT Architect.
Sun Certified Architect(SCEA).
 
 
subject: events
 
Threads others viewed
Errors in the K&B bonus exam?
IBM Mock Question on ActionListener
IBM Mock test
ActionListener interface:
exam lab gc question
IntelliJ Java IDE