declare reset() using the synchronized keyword
declare getName() using the synchronized keyword
declare getCount() using the synchronized keyword
declare the constructor using the synchronized keyword
declare increment() using the synchronized keyword
第1题:
Which of the following commands should be used to assure that a dump can be forced using the reset button on a system without a key switch?()
第2题:
Which statement is true for the class java.util.ArrayList?()
第3题:
public class NamedCounter { private final String name; private int count; public NamedCounter(String name) { this.name = name; } public String getName() { return name; } public void increment() { coount++; } public int getCount() { return count; } public void reset() { count = 0; } } Which three changes should be made to adapt this class to be used safely by multiple threads? ()
第4题:
public class TestFive { private int x; public void foo() { int current = x; x = current + 1; } public void go() { for(int i=0;i<5;i++) { new Thread() { public void run() { foo(); System.out.print(x + “, “); } }.start(); }}} Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5, ?()
第5题:
Which two statements are true?()
第6题:
declare reset() using the synchronized keyword
declare getName() using the synchronized keyword
declare getCount() using the synchronized keyword
declare the constructor using the synchronized keyword
declare increment() using the synchronized keyword
第7题:
It is possible for more than two threads to deadlock at once.
The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
Deadlocked threads release once their sleep() method's sleep duration has expired.
Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
第8题:
When using versions of Java technology earlier than 5.0.
When sharing a StringBuffer among multiple threads.
When using the java.io class StringBufferInputStream.
When you plan to reuse the StringBuffer to build more than one string.
第9题:
SMTP
ICMP
BGP
SSH
RTP
BitTorrent
VTP
第10题:
declare reset() using the synchronized keyword
declare getName() using the synchronized keyword
declare getCount() using the synchronized keyword
declare the constructor using the synchronized keyword
declare increment() using the synchronized keyword
第11题:
Due to a recent change in government regulations, Company.com needs to create two independent but synchronized copies of their data. These copies must be contained in separate storage device a minimum of 100 km apart. The customer has capacity in two systems that meet the criteria, one with SSA disk and the other is FAStT. What facility can be used to manage this issue?()
第12题:
Which three will compile and run without exception?()
第13题:
public class SyncTest { private int x; private int y; public synchronized void setX (int i) (x=1;) public synchronized void setY (int i) (y=1;) public synchronized void setXY(int 1)(set X(i); setY(i);) public synchronized Boolean check() (return x !=y;) } Under which conditions will check () return true when called from a different class?
第14题:
Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()
第15题:
Which two statements are true?()
第16题:
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 */ }
第17题:
All call processing immediately begins using the CRS Subscriber Database.
Calls in queue are dropped.
Agent calls are dropped.
Agents are automatically logged out.
CRS configuration changes are blocked until the CRS Publisher Database is restored and synchronized with the CRS Subscriber Database.
Configuration changes are buffered until the CRS Publisher Database is restored.
第18题:
Move the line 12 print statement into the foo() method.
Change line 7 to public synchronized void go() {.
Change the variable declaration on line 3 to private volatile int x;.
Wrap the code inside the foo() method with a synchronized( this ) block.
Wrap the for loop code inside the go() method with a synchronized block synchronized(this) { // for loop code here }.
第19题:
The elements in the collection are ordered.
The collection is guaranteed to be immutable.
The elements in the collection are guaranteed to be unique.
The elements in the collection are accessed using a unique key.
The elements in the collections are guaranteed to be synchronized.