• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

Help me guys !i need u'r help

Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String s = "message";
Frame f = new Frame();
new ActionListener() {
void ActionPerformed() {System.out.println(s);}
What will you see on screen?
A.Output "message"
B.compile OK, but nothing is shown because the button is not properly added
C.compiler error because s can not be used there
D.compiler error because the listener is not constructed correctly
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer is D, 'coz the semicolon ';' is missing in then end of the addActionListener method call, i.e., after the bracket.
Water! People swim in water! Even tiny ads swim in water:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic