• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IBM questions

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).


 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
He does not suffer fools gladly. But this tiny ad does:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic