SCJP Practice questions – 1

Share this Article :


4) Do nothing, the FlowLayout will position the component
________________________________________
Answer 14)
Objective 8.2)
1) Use the setLayout method
________________________________________
Answer 15)
Objective 8.2)
1) ipadx
2) fill
3) insets
________________________________________
Answer 16)
Objective 8.2)
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)
Objective 8.2)
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)
Objective 7.1)
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)
Objective 8.2)
2) false

You can re-use the same instance of the GridBagConstraints when added successive components.
________________________________________
Answer 20)
Objective 10.1)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Written by bhaskar

{bhaskar has written 11 posts on ITTreats.com . See all posts by }


Leave a Reply