AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-851





Question ID 3899

Given: 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() { count++; }
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? (Choose three.)
 

Option A

A.    declare reset() using the synchronized keyword
 

Option B

B.    declare getName() using the synchronized keyword
 

Option C

C.    declare getCount() using the synchronized keyword
 

Option D

D.    declare the constructor using the synchronized keyword
 

Option E

E.    declare increment() using the synchronized keyword
 

Correct Answer A,C
Explanation


Question ID 3900

Given that t1 is a reference to a live thread, which is true?
 

Option A

A.    The Thread.sleep() method can take t1 as an argument.
 

Option B

B.    The Object.notify() method can take t1 as an argument.
 

Option C

C.    The Thread.yield() method can take t1 as an argument.
 

Option D

D.    The Thread.setPriority() method can take t1 as an argument.
 

Option E

E.    The Object.notify() method arbitrarily chooses which thread to notify.
 

Correct Answer E
Explanation

Send email to admin@getfreedumps for new dumps request!!!