aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes IBM questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "IBM questions" Watch "IBM questions" New topic
Author

IBM questions

Javed Khan
Greenhorn

Joined: Nov 25, 2000
Posts: 22
These are quesions from IBM mock exam.
1)Based upon the code below, which of the answers apply?
public class TestFrame extends Frame {
public TestFrame(String title) {
super(title);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
}

public void
processWindowEvent(WindowEvent we) {
System.out.println("Window event processed");
}
}
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.

Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
2.The way to accumulate drawn objects on the screen is to: (choose only one)

a) Call update() from within repaint()
b) Call paint() from within update()
c) Call update() from within paint()
d) Call paint() directly
e) Call accumulate() from within paint()
My choice is c.

3.Methods for a Component are:

a) add()
b) setbounds()
c) setVisible()
d) setEnabled()
e) addComponent()

Multiple Select - Please select all of the correct answers (this question has 4 correct choices).

My choices are a,c,d and e.

4.To prevent code which follows a try block from being executed when an exception is caught, you can:

a) Code a return statement in the finally clause.
b) Code an end clause.
c) Call System.exit() in the catch clause.
d) Code a return statement in the catch clause
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).


Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
i got the answers as d bcos the listeners will never b called
but i think even b can b correct since it wont object if a listener is added
Please correct me if im wrong
and second is
2) b
3) abcd and
4) acd

please correct me if im wrong
[This message has been edited by Cherry Mathew (edited December 27, 2000).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IBM questions