This code may throw an InterruptedException.
This code may throw an IllegalStateException.
This code may throw a TimeoutException after ten minutes.
This code will not compile unless “obj.wait()” is replaced with “((Thread) obj).wait()”.
Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.
A call to notify() or notifyAll() from another thread may cause this method to complete normally.
第1题:
void waitForSignal() { Object obj = new Object(); synchronized (Thread.currentThread()) { obj.wait(); obj.notify(); } } Which is true?()
第2题:
Given the following code fragment: public void create() { Vector myVect; myVect = new Vector(); } Which of the following statements are true?()
第3题:
Which the two are true about the JSTL core iteration custom tags?()
第4题:
Consider the following class: class Test(int i) { void test(int i) { System.out.println(“I am an int.”); } void test(String s) { System.out.println(“I am a string.”); } public static void main(String args) { Test t=new Test(); char ch=“y”; t.test(ch); } } Which of the statements below is true?()
第5题:
In your Certkiller .com database server the parameter PLSQL_CODE_TYPE has been set to NATIVE. Which object would be achieved by the setting?()
第6题:
You work as an application developer at Certkiller .com. Certkiller .com has instructed you to create a class named MetricFormula. This class will be used to compare MetricUnit and EnglishUnit objects.The MetricFormula is currently defined as follows (Line numbers are used for reference purposes only): 1. public class MetricFormula2. { 3. 4. } You need to ensure that the MetricFormula class can be used to compare the required objects. What should you do? ()
第7题:
The output may be “r1 = 6, r2 = 14”.
The output may be “r1 = 5, r2 = 15”.
The output may be “r1 = 8, r2 = 12”.
The code may run (and complete) with no output.
The code may deadlock (without completing) with no output.
M IllegalStateException or InterruptedException may be thrown at runtime.
第8题:
The code will deadlock.
The code may run with output "2 0 6 4".
The code may run with no output.
The code may run with output "0 6".
An exception is thrown at runtime.
The code may run with output "0 2 4 6".
第9题:
This code will compile.
This code demonstrates proper design of an is-a relationship.
This code demonstrates proper design of a has-a relationship.
A Java programmer using the Team class could remove Player objects from a Team object.
第10题:
The code will deadlock.
The code may run with no output.
An exception is thrown at runtime.
The code may run with output “0 6”.
The code may run with output “2 0 6 4‟.
The code may ruin with output “0 2 4 6”.
第11题:
The source PL/SQL code will be stored in native machine code.
The source PL/SQL code will be stored in interpreted byte code.
The compiled PL/SQL code will be stored in native machine code.
The compiled PL/SQL code will be stored in interpreted byte code.
第12题:
The Error class is a Runtime Exception.
No exceptions are subclasses of Error.
Any statement that may throw an Error must be enclosed in a try block.
any statement that may throw an Exception must be enclosed in a try block.
Any statement that may throw an Runtime Exception must be enclosed in a try block.
第13题:
public class Team extends java.util.LinkedList { public void addPlayer(Player p) { add(p); } public void compete(Team opponent) { /* more code here */ } } class Player { /* more code here */ } Which two are true?()
第14题:
import java.util.*; public class NameList { private List names = new ArrayList(); public synchronized void add(String name) { names.add(name); } public synchronized void printAll() { for (int i = 0; i
第15题:
Which three will compile and run without exception?()
第16题:
class Computation extends Thread { private int num; private boolean isComplete; private int result; public Computation(int num) { this.num = num; } public synchronized void run() { result = num * 2; isComplete = true; notify(); } public synchronized int getResult() { while (!isComplete) { try { wait(); } catch (InterruptedException e) { } } return result; } public static void main(String[] args) { Computation[] computations = new Computation [4]; for (int i = 0; i < computations.length; i++) { computations[i] = new Computation(i); computations[i] .start(); } for (Computation c : computations) System.out.print(c.getResult() +“ “); } } What is the result?()
第17题:
You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code.
第18题:
You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages. You create a static method named SiteHelper.Configure that configures the component. You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested. Which code segment should you use? ()
第19题:
An exception may be thrown at runtime.
The code may run with no output, without exiting.
The code may rum with output “A B A B C C “, then exit.
The code may ruin with output “A A A B C A B C C “, then exit.
The code may rum with output “A B C A B C A B C “, then exit.
The code may ruin with output “A B C A A B C A B C “, then exit.
第20题:
private synchronized Object o;
void go() {synchronized() { /* code here */ }
public synchronized void go() { /* code here */ }
private synchronized(this) void go() { /* code here */ }
void go() {synchronized(Object.class) { /* code here */ }
void go() {Object o = new Object();synchronized(o) { /* code here */ }
第21题:
The declaration on line 2 does not allocate memory space for the variable myVect.
The declaration on line 2 allocates memory space for a reference to a Vector object.
The statement on line 2 creates an object of class Vector.
The statement on line 3 creates an object of class Vector.
The statement on line 3 allocates memory space for an object of class Vector.
第22题:
The source PL/SQL code will be stored in native machine code.
The source PL/SQL code will be stored in interpreted byte code.
The compiled PL/SQL code will be stored in native machine code.
The compiled PL/SQL code will be stored in interpreted byte code.
第23题:
Line 5 will not compile, because void methods cannot be overridden.
Line 12 will not compile, because there is no version of test() that rakes a charargument.
The code will compile but will throw an exception at line 12.
The code will compile and produce the following output: I am an int.
The code will compile and produce the following output: I am a String.