File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IBM questions

 
Javed Khan
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic