Q. 36 Which of the following methods are defined on the Graphics class:
Select all correct answers. Ans:A,B,C Q. 37 Which of the following layout managers honours the preferred size of a component:
Select all correct answers. Ans:B
Q. 38 Given the following code what is the effect of a being 5:
public class Test { public void add(int a) { loop: for (int i = 1; i < 3; i++){ for (int j = 1; j < 3; j++) { if (a == 5) { break loop; } System.out.println(i * j); } } } }
Select the most appropriate answer. Ans:D.
Q. 39 What is the effect of using a wait() method on an object
Select the most appropriate answer. Ans:B
Q. 40 The layout of a container can be altered using which of the following methods:
Select all correct answers. Ans:A
Q. 41 Using a FlowLayout manager, which is the correct way to add elements to a container:
Select the most appropriate answer. Ans:A
Q. 42 Given that a Button can generate an ActionEvent which listener would you expect to have to implement, in a class which would handle this event?
Select the most appropriate answer. Ans:D
Q. 43 Which of the following, are valid return types, for listener methods:
Select the most appropriate answer. Ans:C
Q. 44 Assuming we have a class which implements the ActionListener interface, which method should be used to register this with a Button?
Select the most appropriate answer. Ans:B
Q. 45 In order to cause the paint(Graphics) method to execute, which of the following is the most appropriate method to call:
Select the most appropriate answer. Ans:B Q. 51 Consider the following example:
class First { public First (String s) { System.out.println(s); } } public class Second extends First { public static void main(String args []) { new Second(); } }
What is the result of compiling and running the Second class?
Select the most appropriate answer.
|