Given:
Which two lines inserted in line 1 will allow this code to compile? (Choose two.)
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 the Person class with age and name along with getter and setter methods, and this code fragment:
What will be the result?
A company has an existing sales application using a Java 8 jar file containing packages:
com.company.customer;
com.company.customer.orders;
com.company.customer.info;
com.company.sales;
com.company.sales.leads;
com.company.sales.closed;
com.company.orders;
com.company.orders.pending;
com.company.orders.shipped.
To modularize this jar file into three modules, customer, sales, and orders, which module-info.java would be correct?
A)
B)
C)
D)
Given:
Which two methods facilitate valid ways to read instance fields? (Choose two.)
Which describes a characteristic of setting up the Java development environment?
Given:
jdeps -jdkinternals C:\workspace4\SimpleSecurity\jar\classes.jar
Which describes the expected output?
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 an application with a main module that has this module-info.java file:
Which two are true? (Choose two.)
Given:
Which two statements are valid to be written in this interface? (Choose two.)
Your organization makes mlib.jar available to your cloud customers. While working on a code cleanup project for mlib.jar, you see this method by customers:
What security measures should be added to this method so that it meets the requirements for a customer accessible method?
Why would you choose to use a peek operation instead of a forEach operation on a Stream?
Given:
executed with this command:
java Main one two three
What is the output of this class?
Given:
You want to obtain the Stream object on reading the file. Which code inserted on line 1 will accomplish this?