• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A few doubts

 
Sanjeet Karamchandani
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thes r from Ibm's exam :
21) AWT components get their look and feel from:

a) Programmable painting support classes
b) SWING classes
c) Peer classes
d) JVM drawing primitives
my ans : c

25) Based upon the code below, which of the answers apply?
1. public class TestFrame extends Frame {
2. public TestFrame(String title) {
3. super(title);
4. enableEvents(AWTEvent.WINDOW_EVENT_MASK);
5. }
6.
7. public void
processWindowEvent(WindowEvent we) {
8. System.out.println("Window event processed");
9. }
10. }

a) The window listener that has been added to TestFrame will be called on every window event.
b) This code will compile and run if a window listener is added to an instance of TestFrame.
c) An exception will be thrown if a window listener is added to TestFrame.
d) The window listener that has been added to TestFrame will never get called.
e) This code will not compile if a window listener is added to TestFrame.

my ans : d
Plz help me. Also provide proper reasons for it.
Thanks
Sanjeet
 
paul wheaton
Trailboss
Pie
Posts: 21385
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjeet,
21) Your answer is correct. (does the IBM exam not provide answers?)

As for 25) I think that's the altrnative event handling stuff. My memory isn't very good about what is involved. I think there was some stuff about it in RHE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic