3 Months Free Update
3 Months Free Update
3 Months Free Update
Which interface in the java.util.function package can return a primitive type?
Given:
Which three classes successfully override printOne()? (Choose three.)
Given:
You want the code to produce this output:
John
Joe
Jane
Which code fragment should be inserted on line 1 and line 2 to produce the output?
Given:
You want to obtain the Filechannel object on line 1.
Which code fragment will accomplish this?
A)
B)
C)
D)
Assume ds is a DataSource and the EMP table is defined appropriately.
What does executing this code fragment do?
Which describes a characteristic of setting up the Java development environment?
Given the code fragment:
Which two statement inserted independently at line 1 enable this code to print PRRT?
Given:
executed using command:
java Hello “Hello World” Hello World
What is the output?
Given:
You want to examine the items list it contains an item for which the variable count is below zero.
Which code fragment at line 1 accomplish this?
Given these two classes:
And given this fragment:
Which describes the fragment?
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 set of commands is necessary to create and run a custom runtime image from Java source files?
Given:
Which two methods facilitate valid ways to read instance fields? (Choose two.)
A bookstore's sales are represented by a list of Sale objects populated with the name of the customer and the books they purchased.
public class Sale {
private String customer;
private List
// constructor, setters and getters not shown
}
public class Book {
private String name;
private double price;
// constructor, setters and getters not shown
}
Given a list of Sale objects, tList, which code fragment creates a list of total sales for each customer in ascending order?
var numbers = List.of(0,1,2,3,4,5,6,7,8,9);
You want to calculate the average of numbers. Which two codes will accomplish this? (Choose two.)
Given the code fragment:
Which two code snippets inserted independently inside print method print Mondial: domainmodal?
Which two statements correctly describe capabilities of interfaces and abstract classes? (Choose two.)
Given:
jdeps -jdkinternals C:\workspace4\SimpleSecurity\jar\classes.jar
Which describes the expected output?
Examine this excerpt from the declaration of the java.se module:
What does the transitive modifier mean?
Given:
Which three actions implement Java SE security guidelines? (Choose three.)
Given:
public class X {
}
and
public final class Y extends X {
}
What is the result of compiling these two classes?
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 this enum declaration:
Examine this code:
System.out.println(Alphabet.getFirstLetter());
What code should be written at line 3 to make this code print A?
Given the code fragment:
You want to display the value of currency as $100.00.
Which code inserted on line 1 will accomplish this?
Given:
executed using this command:
java Myclass My Car is red
What is the output of this class?
Analyze the code:
Which two options can you insert inside println method to produce Global:namescope? (Choose two.)
Which is the correct order of possible statements in the structure of a Java class file?
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?
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:
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:
Which two statements are true if the method is added to Bar? (Choose two.)
Given:
and
Which code fragment on line 1 makes the s1 set contain the names of all employees born before January 1, 1989?
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)