Given the content of /resourses/Message.properties:
welcome1=”Good day!”
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream (“/resources/Message.properties”);
prop.load(fis);
System.out.println(prop.getProperty(“welcome1”));
System.out.println(prop.getProperty(“welcome2”, “Test”));//line n1
System.out.println(prop.getProperty(“welcome3”));
What is the result?
and the code fragment?
What is the result?
Which statement is true about the single abstract method of the java.util.function.Predicate interface?
Given the content of Operator.java, EngineOperator.java, and Engine.java files:
and the code fragment:
What is the result?
Given:
and the code fragment:
What is the result?
Given the code fragments:
class Employee {
Optional
address;Employee (Optional
address) {this.address = address;
}
public Optional
getAddress() { return address; }}
class Address {
String city = “New York”;
public String getCity { return city: }
public String toString() {
return city;
}
}
and
Address address = new Address;
Optional
addrs1 = Optional.ofNullable (address);Employee e1 = new Employee (addrs1);
String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : “City Not
available”;
System.out.println(eAddress);
What is the result?
Given the code fragments:
and
What is the result?
Given the code fragment:
public class FileThread implements Runnable {
String fName;
public FileThread(String fName) { this.fName = fName; }
public void run () System.out.println(fName);}
public static void main (String[] args) throws IOException, InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
Stream
listOfFiles.forEach(line -> {
executor.execute(new FileThread(line.getFileName().toString())); //
line n1
});
executor.shutdown();
executor.awaitTermination(5, TimeUnit.DAYS);//
line n2
}
}
The Java Projects directory exists and contains a list of files.
What is the result?
Given the code fragment:
What is the result?
Given the code fragment:
Stream
files.forEach (fName -> {//line n1
try {
Path aPath = fName.toAbsolutePath();//line n2
System.out.println(fName + “:”
+ Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime
());
} catch (IOException ex) {
ex.printStackTrace();
});
What is the result?
PDF + Testing Engine
|
---|
$66 |
Testing Engine
|
---|
$50 |
PDF (Q&A)
|
---|
$42 |
Oracle Free Exams |
---|
![]() |