Questions « Utility Classes « SCJP






8.34.Questions
8.34.1.A Hashtable requires String objects as keys(True/False).
8.34.2.Answer: hash table key
8.34.3.A Hashtable maintains object references in the order they were added(True/False).
8.34.4.Answer: hash table value reference
8.34.5.Both Vector and Hashtable use synchronized methods to avoid concurrent problems(True/False).
8.34.6.Answer: synchronization Vector and Hashtable
8.34.7.Which of the following are interfaces? [Check all correct answers]
8.34.8.Answer: collection interface and class
8.34.9.Which class is most similar to the Vector class?








8.34.10.Answer: Vector like collections
8.34.11.Which interface does Hashtable implement?
8.34.12.Answer: interface for Hashtable
8.34.13.Which of the following layout managers can be used to display nine Button objects at one time?
8.34.14.Answer: layout
8.34.15.Which of the following are valid alignment parameters for a FlowLayout?
8.34.16.Answer: flow layout
8.34.17.Which of the following layout managers does not alter the height of a component?
8.34.18.Answer: layout and component height
8.34.19.For JPanel(new GridLayout(4,4,5,8)), the horizontal space between the buttons will be five pixels(True/False).








8.34.20.Answer: GridLayout
8.34.21.For GridLayout, the order in which the Button objects are added controls their position, filling a row first, from left to right (True/False).
8.34.22.Answer: GridLayout(3)
8.34.23.Which variable in the GridBagConstraints class can use the constant named CENTER?
8.34.24.Answer: GridBagConstraints
8.34.25.Which layout manager ensure that at least a portion of each button added is displayed even when the Panel has been resized to a small size?
8.34.26.Answer: layout manager
8.34.27.Which constant names are valid positioning options in the GridBagConstraints class?
8.34.28.Answer: using GridBagConstraints
8.34.29.Which of the following classes produce immutable objects?
8.34.30.Answer: immutable objects
8.34.31.What is the result(autoboxing and parameter passing)?
8.34.32.Answer: autoboxing and parameter passing
8.34.33.What happens when you compile and run code containing the following lines?
8.34.34.Answer: autoboxing and calculation
8.34.35.What is the output(substring and file extension name)?
8.34.36.Answer: substring and file extension name
8.34.37.What is the result(String reference)?
8.34.38.Answer: String reference