• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

events

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Code compiles and runs successfully, if U have RHE then u will find the similar question and the explanation over there.
Hope this helps
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aruna,
May be you can tell us what is confusing about this question.
Ajith
 
reply
    Bookmark Topic Watch Topic
  • New Topic