Given the code fragment:
BiFunction
What is the result?
Correct Answer:
C
Which two statements are true about localizing an application? (Choose two.)
Correct Answer:
AE
Given:
class ImageScanner implements AutoCloseable { public void close () throws Exception { System.out.print (“Scanner closed.”);
}
public void scanImage () throws Exception { System.out.print (“Scan.”);
throw new Exception(“Unable to scan.”);
}
}
class ImagePrinter implements AutoCloseable { public void close () throws Exception { System.out.print (“Printer closed.”);
}
public void printImage () {System.out.print(“Print.”); }
}
and this code fragment:
try (ImageScanner ir = new ImageScanner(); ImagePrinter iw = new ImagePrinter()) { ir.scanImage();
iw.printImage();
} catch (Exception e) { System.out.print(e.getMessage());
}
What is the result?
Correct Answer:
A
Given the code fragment:
You have been asked to define the ProductCode class. The definition of the ProductCode class must allow c1 instantiation to succeed and cause a compilation error on c2 instantiation.
Which definition of ProductCode meets the requirement?
Correct Answer:
B
Given the code fragment:
What is the result?
Correct Answer:
A