Question: 1
Given the code fragment:

What is the result?
Question: 2
Given the code fragment:

What is the result?
Question: 3
Given the code fragments:
class MyThread implements Runnable {
private static AtomicInteger count = new AtomicInteger (0);
public void run () {
int x = count.incrementAndGet();
System.out.print (x+'' '');
}
}
and
Thread thread1 = new Thread(new MyThread());
Thread thread2 = new Thread(new MyThread());
Thread thread3 = new Thread(new MyThread());
Thread [] ta = {thread1, thread2, thread3};
for (int x= 0; x < 3; x++) {
ta[x].start();
}
Which statement is true?
Question: 4
Given the code fragment:

and the information:
The required database driver is configured in the classpath.
The appropriate database is accessible with the dbURL, username, and passWord exists.
What is the result?
Question: 5
Given the code fragment:
class CallerThread implements Callable {
String str;
public CallerThread(String s) {this.str=s;}
public String call() throws Exception {
return str.concat(''Call'');
}
}
and
public static void main (String[] args) throws InterruptedException, ExecutionException
{
ExecutorService es = Executors.newFixedThreadPool(4); //line n1
Future f1 = es.submit (newCallerThread(''Call''));
String str = f1.get().toString();
System.out.println(str);
}
Which statement is true?