Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes A few doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A few doubts" Watch "A few doubts" New topic

A few doubts

Sanjeet Karamchandani
Ranch Hand

Joined: Jul 29, 2000
Posts: 30
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. }
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.
paul wheaton

Joined: Dec 14, 1998
Posts: 20896

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.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
I agree. Here's the link:
subject: A few doubts
It's not a secret anymore!