2011年JAVA认证模拟题(43)
Q127 Given a component, comp, and a container, cont, that is organized according to a FlowLayout, which of the following should be used to add comp to the container.A cont.add(comp);
B comp.add(cont);
C cont.addComponent(comp);
D cont.addAllComponents();
Q128 What is wrong with the following if statement?
if(x++) {
y = x * z;
x /=2;
else {
y = y * y;
++z;
}
A The if condition should use a prefix operator instead of a postfix operator.
B The if condition must be a boolean expression, not a numeric expression
C There is a missing } before the else.
D There is no break statement to allow control to transfer out of the if statement.
Q129 Which of the following are true?
A The event-inheritance model has replaced the event-delegation model.
B The event-inheritance model is more efficient than the event-delegation model.中 华 考 试 网
C The event-delegation model uses event listener to define the methods of event-handling classes.
D The event-delegation model uses the handleEvent() method to support event handling.
Q127 A
Q128 BC
Q129 C
页:
[1]