Unlock Your Oracle Java SE 8 Programmer II Potential: Master 1Z0-809 Now!
Given:
public class Emp {
String fName;
String lName;
public Emp (String fn, String ln) {
fName = fn;
lName = ln;
}
public String getfName() { return fName; }
public String getlName() { return lName; }
}
and the code fragment:
List
new Emp (''John'', ''Smith''),
new Emp (''Peter'', ''Sam''),
new Emp (''Thomas'', ''Wale''));
emp.stream()
//line n1
.collect(Collectors.toList());
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then ascending order of lName?
Correct : B
Start a Discussions
Given:
public class Test
private T t;
public T get () {
return t;
}
public void set (T t) {
this.t = t;
}
public static void main (String args [ ] ) {
Test
Test type 1 = new Test ();//line n1
type.set(''Java'');
type1.set(100);//line n2
System.out.print(type.get() + '' '' + type1.get());
}
}
What is the result?
Correct : A
Start a Discussions
Given the code fragment:
Path path1 = Paths.get(''/app/./sys/'');
Path res1 = path1.resolve(''log'');
Path path2 = Paths.get(''/server/exe/'');
Path res1 = path1.resolve(''/readme/'');
System.out.println(res1);
System.out.println(res2);
What is the result?
Correct : C
Start a Discussions
Which statement is true about jav
a.util.stream.Stream?
Correct : B
Start a Discussions
Which two methods from the jav
a.util.stream.Stream interface perform a reduction operation? (Choose two.)
Correct : A, B
Start a Discussions
Total 208 questions