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 3722

Given:
1.    public class Threads5 {
2.    public static void main (String[] args) {
3.    new Thread(new Runnable() {
4.    public void run() {
5.    System.out.print("bar");
6.    }}).start();
7.    }
8.    }
What is the result?
 

Option A

A.    Compilation fails.
 

Option B

B.    An exception is thrown at runtime.
 

Option C

C.    The code executes normally and prints "bar".
 

Option D

D.    The code executes normally, but nothing prints.
 

Correct Answer C
Explanation


Question ID 3723

Given:
11.    public class PingPong implements Runnable {
12.    synchronized void hit(long n) {
13.    for(int i = 1; i < 3; i++)
14.    System.out.print(n + "-" + i + " ");
15.    }
16.    public static void main(String[] args) {
17.    new Thread(new PingPong()).start();
18.    new Thread(new PingPong()).start();
19.    }
20.    public void run() {
21.    hit(Thread.currentThread().getId());
22.    }
23.    }
Which two statements are true? (Choose two.)
 

Option A

A.    The output could be 8-1    7-2    8-2    7-1

 

Option B

B.    The output could be 7-1    7-2    8-1    6-1
 

Option C

C.    The output could be 8-1    7-1    7-2    8-2
 

Option D

D.    The output could be 8-1    8-2    7-1    7-2

Correct Answer C,D
Explanation

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