- •11. Which of the following statements imports the entire package java.Util into a Java program? (a) import util; (b) import util.*; (c) import java.Util.*; (d) import java.Util;
- •13. After a breakpoint is hit, a debugger is typically used for which of the following tasks?
- •I. Stepping through method calls, line by line II. Examining a stack trace
- •III. Examining values of variables in the current method
- •36. Consider the following Java program segment.
- •37. If a class contains a constructor, that constructor will be invoked
- •39. Consider the following uml class diagram.
- •Which of the following kinds of associations is not indicated by the class diagram?
- •47. Consider the following uml class diagram.
- •Which of the following may be substituted for X in the above diagram to represent a multiplicity between a and b?
- •61. Consider the following Java program segment.
- •83. In object-oriented design, types of multiplicity for associations among classes include which of the following?
- •(A) I and II only (b) I, II, and III (c) I and III only (d) II and III only
- •96. In Java, which of the following is (are) true regarding interfaces?
- •I. An interface can extend a class. II. An interface can extend multiple interfaces. (a) I only (b) None (c) I and II (d) II only
- •99. Which of the following is (are) true regarding the strategy design pattern?
- •I. A family of algorithms are combined into a large single method. II. Polymorphism is used.
- •106. Which of the following Java program segments will compile and execute without error?
- •System.Out.Println(numbers[I]);
- •System.Out.Println(numbers[I]);
- •107. Consider the following uml class diagram.
- •109. Consider the following uml class diagram.
- •111. Consider the following uml class diagram.
- •115. Which of the following Java method declarations does not require that the method return a value? (a) private int myMethod(); (b) private static int myMethod();
109. Consider the following uml class diagram.
According to the diagram, which of the following statements is (are) true?
I .ClassB is a specialization of ClassA.
II .ClassA is a generalization of ClassC.
III .ClassC is involved in a self-containment loop.
(a) I and III only (b) II and III only (c) I, II, and III (d) I and II only
110. Consider the following Java program segment.
public class Foo {
public static int x;
}
If two separate Foo objects are instantiated, x is created in memory _____ time(s) because it is a _____ variable.
(a) one, class (b) one, instance (c) two, instance (d) two, class
111. Consider the following uml class diagram.
The diagram describes a
(a) relationship between a subclass and a superclass (b) one-to-one relationship
(c) self-containing class (d) class without methods
112. If a class has an association with itself, then the class contains
(a) a method that calls another method within the same class
(b) an attribute that references an object of the same class
(c) a method that calls itself (d) its own superclass
113. In an object model, the data that an object is responsible for maintaining are represented by
(a) attributes (b) methods (c) specializations (d) generalizations
114. An object model describes which of the following?
I .Attributes of classes
II .Methods of classes
III .Relationships between classes
(a) I and II only (b) I, II, and III (c) II and III only (d) I and III only
115. Which of the following Java method declarations does not require that the method return a value? (a) private int myMethod(); (b) private static int myMethod();
(c) public String myMethod(); (d) public void myMethod();
