int i=0xFFFFFFF1; int j=~i; } } What is the value decimal value of j at line 5? A.0 B.1 C.14 D.-15 F.An error at line 3 causes compilation to fail G.An error at line 4 causes compilation to fail
90. Which two demonstrate an “is a” relationship?(2) A.public interface Person{} public class Employee extends Person{} B.public interface Shape{} public interface Retangle extends Shape{} C.public interface Color{} public class Shape{private Color color;} D.public class Species{} public class Animal{private Species species;} E.interface Component{} class Container implements Component{ private Component [] children; }
91.Given Package foo;
public class Outer{ public static class Inner{ } } Which statement is true? A.An instance of the Inner class can be constructed with “new Outer.Inner(): B.An instance of the Inner class cannot be constructed outside of package foo; C.An instance of the Inner class can only be constructed from within the Outer class. D.From within the package bar, an instance of the Inner class can be constructed with “new Inner()”.
92.Which statement is true? A.An anonymous inner class may be declared as final. B.An anonymous inner class can be declared as private. C.An anonymous inner class can implement multiple interfaces . D.An anonymous inner class can access final variables in any enclosing scope. E.Construction of an instance of a static inner class requires an instance of the enclosing outer class.
93.Which statement is true? A.If only one thread is blocked in the wait method of an object, and another thread executes the notify method on that same object , then the first thread immediately resumes execution. B.If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution. C.If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread definitely resumes execution as a direct and sole consequence of the notify call. D.If two threads are blocked in the wait method of one object , and another thread executes the notify method on the same object, then the thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.
94. You are assigned the task of building a Panel containing a TextArea at the top, a Label directly below it, and a Button directly Below the Label. If the three components are added directly to the Panel, which layout manager can the Panel use to ensure that the TextArea absorbs all of the free vertical space when the Panel is resized? A.GridLayout B. FlowLayout C. GridBagLayout D. CardLayout E. BorderLayout
95. Given: String foo =”ABCDE” foo.substring(3); foo.concat(“XYZ”);
What is the value of the variable foo at line 4? Shortanswer:
96. Which statement about static inner classes is true? A.An anonymous class can be declared as static B.A static inner class cannot be a static member of the outer class C.A static inner class does not require an instance of the enclosing class D.Instance members of a static inner class can be referenced using the class name of the static inner class
97. Which statement is true for the class java.util.ArrayList? A.The elements in the collection are ordered. B.The collection is guaranteed to be immutable C.The elements in the collection are guaranteed to be unique D.The elements in the collection are accessed using a unique key |