![]() |
|
answer 15)
1) ipadx
2) fill
3) insets
answer 16)
2) the buttons will run from left to right along the top of the frame
the call to the setlayout(new flowlayout()) resets the layout manager for the entire frame and so the buttons end up at the top rather than the bottom.
answer 17)
2) it is a field of the gridbagconstraints class for controlling component placement
3) a valid settting for the anchor field is gridbagconstraints.north
answer 18)
4) clean compile but no output at runtime
this is a bit of a sneaky one as i have swapped around the names of the methods you need to define and call when running a thread. if the for loop were defined in a method called public void run() and the call in the main method had been to b.start() the list of values from 0 to 9 would have been output.
answer 19)
2) false
you can re-use the same instance of the gridbagconstraints when added successive components.
answer 20)
4) an interface that ensures that implementing classes cannot contain duplicates
answer 21)
2) the add method returns false if you attempt to add an element with a duplicate value
i find it a surprise that you do not get an exception.
answer 22)
1) the program exits via a call to exit(0);
2) the priority of another thread is increased
3) a call to the stop method of the thread class
note that this question asks what can cause a thread to stop executing, not what will cause a thread to stop executing. java threads are somewhat platform dependent and you should be carefull when making assumptions about thread priorities. on some platforms you may find that a thread with higher priorities gets to "hog" the processor. you can read up on this in more detail at
[1] [2] [3] [4] [5] [6] [7] [8] [9] 