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?
Which class definition compiles?
Given the code fragment:
List
Predicate
int i = 0;
boolean result = s.contains (“pen”);
System.out.print(i++) + “:”);
return result;
};
str.stream()
.filter(test)
.findFirst()
.ifPresent(System.out ::print);
What is the result?
Given:
What is the result?
Given:
and the code fragment:
What is the result?
Given the code fragment:
What is the result?
Given:
and
Which interface from the java.util.function package should you use to refactor the class Txt?
Given the code fragment:
List
System.out.println (
// line n1
);
Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
Given the code fragment:
public static void main (String [ ] args) throws IOException {
BufferedReader br = new BufferedReader (new InputStremReader (System.in));
System.out.print (“Enter GDP: “);
//line 1
}
Which code fragment, when inserted at line 1, enables the code to read the GDP from the user?
Which two statements are true about synchronization and locks? (Choose two.)