answer 11)
2)myarray.length;
the string class has a length() method to return the number of characters. i have sometimes become confused between the two.
answer 12)
3) a frame with one large button marked four in the centre
the default layout manager for a frame is the borderlayout manager. this layout manager defaults to placing components in the centre if no constraint is passed with the call to the add method.
answer 13)
4) do nothing, the flowlayout will position the component
answer 14)
1) use the setlayout method
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
上一页 [1] [2] [3] [4] [5] [6] 下一页
责任编辑:小草