Given:
You want to obtain the Stream object on reading the file. Which code inserted on line 1 will accomplish this?
Given:
Which statement on line 1 enables this code fragment to compile?
Given the code fragment:
Which can replace line 2?
Given the content from the course.txt file:
Which code fragment at line 1 prints the lines that contain Java from the course.txt file?
A)
B)
C)
D)
E)
Which two statements are true about Java modules? (Choose two.)
Given:
What is the result?
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:
What is the result?
Given:
and
Which two method definitions at line n1 in the Bar class compile? (Choose two.)
Given:
You want to obtain the Filechannel object on line 1.
Which code fragment will accomplish this?
A)
B)
C)
D)
Given:
List
List
Which code fragment correctly forms a short list of words containing the letter “e”?
Given:
Assume the file on path does not exist. What is the result?
Given:
What is the result?
Given:
Which statement is true?
Given:
Taking into account that the order of the elements is unpredictable, what is the output?
Given the code fragment:
Path currentFile = Paths.get(“/scratch/exam/temp.txt”);
Path outputFile = Paths get(“/scratch/exam/new.txt”);
Path directory = Paths.get(“/scratch/”);
Files.copy(currentFile, outputFile);
Files.copy(outputFile, directory);
Files.delete (outputFile);
The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist.
What is the result?
Given:
Which two statements can be added at line 1 in Bar to successfully compile it? (Choose two.)
Given:
You want to use the myResource class in a try-with-resources statement. Which change will accomplish this?
Given:
What is the result?
Given:
What is the result?
Given:
What is the result?
Given:
executed using command:
java Hello “Hello World” Hello World
What is the output?
Which two commands are used to identify class and module dependencies? (Choose two.)
What is the result?
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:
You want to implement the java.io.Serializable interface to the MyPersistenceData class.
Which method should be overridden?
Given:
Which annotation should be used to remove warnings from compilation?
Given the code fragment:
What is the result?
Given:
Which two method implementations are correct, when inserted independently in line 1? (Choose two.)
Given:
What is the result?
A)
B)
C)
D)
Given:
What is the result?
Given:
Which is true?
Given:
Which statement is equivalent to line 1?
Given:
/code/a/Test.java
containing:
and
/code/b/Best.java
containing:
package b;
public class Best { }
Which is the valid way to generate bytecode for all classes?
Which code fragment added to line 1 enables the code to compile and print Hello Joe?
A)
B)
C)
D)
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:
What is the result?
Given the code fragment:
Which two statement inserted independently at line 1 enable this code to print PRRT?