Given:
Which is true about line 1?
Given:
What is the result?
Given the code fragment:
What is the result?
Given:
Which two lines inserted in line 1 will allow this code to compile? (Choose two.)
Given the code fragment:
Which code fragment replaces the for statement?
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 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:
List
List
Which code fragment correctly forms a short list of words containing the letter “e”?
Given:
What action ensures successful compilation?
Given:
Which two statements are true if the method is added to Bar? (Choose two.)