Analyze the code:
Which two options can you insert inside println method to produce Global:namescope? (Choose two.)
Given:
After which line can we insert assert i < 0 || values[i] <= values[i + 1]; to verify that the
values array is partially sorted?
Given:
This code results in a compilation error.
Which code should be inserted on line 1 for a successful compilation?
Given:
A) An exception is thrown at run time.
B)
C) The compilation fails due to an error on line 2.
D) The compilation fails due to an error on line 1.
E)
F)
The compilation fails due to an error on line 3.
Examine these module declarations:
Which two statements are correct? (Choose two.)
Given:
and
checkQuality(QUALITY.A);
and
Which code fragment can be inserted into the switch statement to print Best?
Given:
and
Which two method definitions at line n1 in the Bar class compile? (Choose two.)
Given:
Which two independent changes will make the Main class compile? (Choose two.)
Given an application with a main module that has this module-info.java file:
Which two are true? (Choose two.)
Given the declaration:
Examine this code fragment:
/* Loc1 */ class ProcessOrders { ... }
Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)
Given the code fragment:
You want to display the value of currency as $100.00.
Which code inserted on line 1 will accomplish this?
A company has an existing Java app that includes two Java 8 jar files, sales-3.10. jar and clients-10.2.jar.
The jar file ,sales -8, 10, jar reference packages in clients -10.2 jar, but clients-10.2 jar does not reference packages in sales -8.10, jar.
They have decided to modularize clients-10.2.jar.
Which module-info. Java file would work for the new library version clients-10.3 jar?
A)
B)
C)
D)
Assume ds is a DataSource and the EMP table is defined appropriately.
What does executing this code fragment do?
Assuming the Widget class has a getPrice method, this code does not compile:
Which two statements, independently, would allow this code to compile? (Choose two.)
Given:
Which two statements are true if the method is added to Bar? (Choose two.)
Which command line runs the main class com.acme.Main from the module com.example?
Given the code fragment:
Which two statement inserted independently at line 1 enable this code to print PRRT?
Given this enum declaration:
Examine this code:
System.out.println(Letter.values()[1]);
What code should be written at line 5 for this code to print 200?
Given the contents:
MessageBundle.properties file:
message=Hello
MessageBundle_en.properties file:
message=Hello (en)
MessageBundle_US.properties file:
message=Hello (US)
MessageBundle_en_US.properties file:
message=Hello (en_US)
MessageBundle_fr_FR.properties file:
message=Bonjour
and the code fragment:
Locale.setDefault(Locale.FRANCE);
Locale currentLocale = new Locale.Builder().setLanguage(“en”).build();
ResourceBundle messages = ResourceBundle.getBundle(“MessageBundle”, currentLocale);
System.out. println(messages.getString(“message”));
Which file will display the content on executing the code fragment?
Given:
and the code fragment:
Which two Map objects group all employees with a salary greater than 30 by neighborhood? (Choose two.)
A)
B)
C)
D)
E)
Which code fragment added to line 1 enables the code to compile and print Hello Joe?
A)
B)
C)
D)
Given the formula to calculate a monthly mortgage payment:
and these declarations:
How can you code the formula?
Which two statements set the default locale used for formatting numbers, currency, and percentages? (Choose two.)
Given:
Which three actions implement Java SE security guidelines? (Choose three.)
Your organization provides a cloud server to your customer to run their Java code. You are reviewing the changes for the next release and you see this change in one of the config files:
Which is correct?
Given:
public class X {
}
and
public final class Y extends X {
}
What is the result of compiling these two classes?
Given the code fragment:
Which two code snippets inserted independently inside println method print Mondial:domainmodel? (Choose two.)
Which interface in the java.util.function package will return a void return type?
Given:
You want to obtain the Stream object on reading the file. Which code inserted on line 1 will accomplish this?
Given:
var fruits = List.of(“apple”, “orange”, “banana”, “lemon”);
You want to examine the first element that contains the character n. Which statement will accomplish this?
Given:
List
list1.add(“A”);
list1.add(“B”);
List list2 = List.copyOf(list1);
list2.add(“C”);
List> list3 = List.of(list1, list2);
System.out.println(list3);
What is the result?
Given:
LocalDate d1 = LocalDate.of(1997,2,7);
DateTimeFormatter dtf =
DateTimeFormatter.ofPattern( /*insert code here*/ );
System.out.println(dtf.format (d1));
Which pattern formats the date as Friday 7th of February 1997?