Which two are functional interfaces? (Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Given the declaration:
Examine this code fragment:
/* Loc1 */ class ProcessOrders { ... }
Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)
A. @Resource(priority=100)
B. @Resource(priority=0)
C. @Resource(name="Customer1", priority=100)
D. @Resource(name="Customer1")
E. @Resource
Given: Which one is correct?
A. An IllegalThreadStateException is thrown at run time.
B. Three threads are created.
C. The compilation fails.
D. Four threads are created.
Given:
You want to use the myResource class in a try-with-resources statement. Which change will accomplish this?
A. Extend AutoCloseable and override the close method.
B. Implement AutoCloseable and override the autoClose method.
C. Extend AutoCloseable and override the autoClose method.
D. Implement AutoCloseable and override the close method.
Given:
Which two are correct? (Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Given: String originalPath = "data\\projects\\a-project\\..\\..\\another-project"; Path path = Paths.get(originalPath); System.out.print(path.normalize());
What is the result?
A. data\another-project
B. data\projects\a-project\another-project
C. data\\projects\\a-project\\..\\..\\another-project
D. data\projects\a-project\..\..\another-project
Given the Person class with age and name along with getter and setter methods, and this code fragment:
What will be the result?
A. Aman Tom Peter
B. Tom Aman Peter
C. Aman Peter Tom
D. Tom Peter Aman
Which two statements set the default locale used for formatting numbers, currency, and percentages? (Choose two.)
A. Locale.setDefault(Locale.Category.FORMAT, "zh-CN");
B. Locale.setDefault(Locale.Category.FORMAT, Locale.CANADA_FRENCH);
C. Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
D. Locale.setDefault("en_CA");
E. Locale.setDefault("es", Locale.US);
Which two statements independently compile? (Choose two.)
A. List super Short> list = new ArrayList
B. List super Number> list = new ArrayList
C. List extends Number> list = new ArrayList
D. List extends Number> list = new ArrayList
E. List super Float> list = new ArrayList
Given:
jdeps -jdkinternals C:\workspace4\SimpleSecurity\jar\classes.jar
Which describes the expected output?
A. jdeps lists the module dependencies and the package names of all referenced JDK internal APIs. If any are found, the suggested replacements are output in the console.
B. jdeps outputs an error message that the -jdkinternals option requires either the -summary or the verbose options to output to the console.
C. The -jdkinternals option analyzes all classes in the .jar and prints all class-level dependencies.
D. The -jdkinternals option analyzes all classes in the .jar for class-level dependencies on JDK internal APIs. If any are found, the results with suggested replacements are output in the console.