1.
What design pattern does the Drivermanager.getconnection () method characterize?
2.
Given the code fragment:
dataFormat df;

Which statement defines a new DataFormat object that displays the default date format for the UK Locale?
3.
Given three resource bundles with these values set for menu1: ( The default resource bundle is written in US English.)
English US resource Bundle
Menu1 = small
French resource Bundle
Menu1 = petit
Chinese Resource Bundle
Menu = 1

And given the code fragment:
 
Locale.setDefault (new Locale("es", "ES")); // Set default to Spanish and Spain loc1 = Locale.getDefault();
ResourceBundle messages = ResourceBundle.getBundle ("messageBundle", loc1); System.out.println (messages.getString("menu1"));

What is the result?
4.
Given:
import java.util.*;
public class StringApp {
public static void main (String [] args) {
Set
}
}
System.out.println ("\ncount = " + count);
}
count++;
}
break;
System.out.print("Y ");
case "Y":
break;
System.out.print("X ");
case "X":
switch (it.next()){
while (it.hasNext()) {
int count = 0;
it = set.iterator ();
Iterator
set.add("X");
set.add("Y");
set.add("X");
set.add("Y");
set.add("X");
set = new TreeSet <> ();

What is the result?
5.
Given the code fragment:
List
();
pList = new CopyOnWriteArrayList

Which statement is true?
6.
Given the fragment: public class CustomerApplication { public static void main (String [] args) { CustomerDAO custDao = new CustomerDAOMemoryImp1 (); // . . . other methods } } Which two valid alternatives to line 3 would decouple this application from a specific implementation of customerDAO?
7.
Given:
public class SampleClass {
public static void main(String[] args) {
SampleClass sc = new SampleClass();
sc.processCD();
}
private void processCD() {
try (CDStream cd = new CDStream()) {
cd.open();
cd.read();
cd.write("lullaby");
cd.close();
} catch (Exception e) {
System.out.println("Exception thrown");
}
}
class CDStream {
String cdContents = null;
public void open() {
cdContents = "CD Contents";
System.out.println("Opened CD stream");
}
public String read() throws Exception {
throw new Exception("read error");
}
public void write(String str) {
System.out.println("CD str is: " + str);
}
public void close() {

cdContents = null;
}

What is the result?
8.
Two companies with similar robots have merged. You are asked to construct a new program that allows the features of the robots to be mixed and matched using
composition. Given the code fragments:
public class CrusherRobot {
public void walk () {}
public void positionArm (int x, int y, int z) {}
public void raiseHammer() {}
public void dropHammer() {}
}
public class GripperRobot {
public void walk() {}
public void moveArm (int x, int y, int z) {}
public void openGripper () {}
public void closeGripper() {}
}

When applying composition to these two classes, what functionality should you extract into a new class?
9.
Which three must be used when using the Java.util.concurrent package to execute a task that returns a result without blocking?
10.
Which statement creates a low-overhead, low contention random number generator that is isolated to a thread to generate a random number between 1 and 100?