Pass the Oracle Java SE 1z0-809 Questions and answers with CertsForce

Viewing page 7 out of 7 pages
Viewing questions 61-70 out of questions
Questions # 61:

Given the code fragment:

Question # 61

What is the result?

Options:

A.

[X][X, X][X, X, X][X, X, X, X]


B.

[X, X]


C.

[X][X, X][X, X, X]


D.

[X, X][X, X, X, X]


Expert Solution
Questions # 62:

Given the code fragments:

Question # 62

and

Question # 62

Which two modifications enable to sort the elements of the emps list? (Choose two.)

Options:

A.

Replace line n1 withclass Person extends Comparator


B.

At line n2 insertpublic int compareTo (Person p) {return this.name.compareTo (p.name);}


C.

Replace line n1 withclass Person implements Comparable


D.

At line n2 insertpublic int compare (Person p1, Person p2) {return p1.name.compareTo (p2.name);}


E.

At line n2 insert:public int compareTo (Person p, Person p2) {return p1.name.compareTo (p2.name);}


F.

Replace line n1 withclass Person implements Comparator


Expert Solution
Viewing page 7 out of 7 pages
Viewing questions 61-70 out of questions