The equals() method determines if reference values refer to the same object.
The == operator determines if the contents and type of two separate objects match.
The equals() method returns true only when the contents of two objects match.
The class File overrides equals() to return true if the contents and type of two separate objects match.
第1题:
1. public class Person { 2. private String name; 3. public Person(String name) { this.name = name; } 4. public boolean equals(Person p) { 5. return p.name.equals(this.name); 6. } 7. } Which is true?()
第2题:
Which of the following statements about variables and scope are true?()
第3题:
A. A routed protocol is assigned to an interface and determines the method of packet deliver.
B. A routing protocol determines the path of a packet through a network.
C. A routed protocol determines the path of a packet through a network.
D. A routing protocol operates at the transport layer of the OSI model.
E. A routed protocol updates the routing table of a router.
第4题:
public class Person { private name; public Person(String name) { this.name = name; } public boolean equals(Object o) { if( !o instanceof Person ) return false; Person p = (Person) o; return p.name.equals(this.name); } } Which is true?()
第5题:
Which of the following statements are true?()
第6题:
Which two statements are true regarding the return values of property written hashCode and equals methods from two instances of the same class?()
第7题:
Given that b and c refer to instances of wrapper classes, which two statements are true?()
第8题:
A. A routing protocol is assigned to an interface and determines the method of packet delivery.
B. A routed protocol is assigned to an interface and determines the method of packet delivery.
C. A routing protocol determines the path of a packet through a network.
D. A routed protocol determines the path of a packet through a network.
E. A routing protocol operates at the transport layer of the OSI model.
F. A routed protocol updates the routing table of a router.
第9题:
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()
第10题:
Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()