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 list = new ArrayList
B. List list = new ArrayList
C. List list = new ArrayList
D. List list = new ArrayList