AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-851





Question ID 3869

Given:
11.    public class Person {
12.    private String name;
13.    public Person(String name) {
14.    this.name = name;
15.    }
16.    public boolean equals(Object o) {
17.    if ( ! ( o instanceof Person) ) return false;
18.    Person p = (Person) o;
19.    return p.name.equals(this.name);
20.    }
21.    }
Which statement is true?


 

Option A

A.    Compilation fails because the hashCode method is not overridden.
 

Option B

B.    A HashSet could contain multiple Person objects with the same name.
 

Option C

C.    All Person objects will have the same hash code because the hashCode method is not overridden.
 

Option D

D.    If a HashSet contains more than one Person object with name="Fred", then removing another Person, also with name="Fred", will remove
them all.

Correct Answer B
Explanation


Question ID 3870

Given:
3.    import java.util.*;
4.    public class Hancock {
5.    // insert code here
6.    list.add("foo");
7.    }
8.    }
Which two code fragments, inserted independently at line 5, will compile without warnings? (Choose two.)
 

Option A

A.    public void addStrings(List list) {
 

Option B

B.    public void addStrings(List<String> list) {
 

Option C

C.    public void addStrings(List<? super String> list) {
 

Option D

D.    public void addStrings(List<? extends String> list) {
 

Correct Answer B,C
Explanation

Send email to admin@getfreedumps for new dumps request!!!