For the given class, which of the following would be the best hashCode function implementation?

public class Employee {
private String name, surname;

public Employee(String name, String surname) {
this.name = name;
this.surname = surname;
}
}

a. public int hashCode() {
return this.name + this.surname;
}
b. public int hashCode() {
return 1;
}
c. public int hashCode() {
return (int)(Math.random() * 100);
}
d. public String hashCode() {
return this.surname.concat(this.name);
}


a. public int hashCode() {
return this.name + this.surname;
}

Computer Science & Information Technology

You might also like to view...

The business of making multimedia is a "low entry barrier" enterprise because:

a. those with disabilities can create multimedia. b. all you need to get started is some (relatively) inexpensive computer hardware and software. c. free or low-cost Web hosting solutions available. d. lots of people can access Web sites and CD-ROMs. e. authoring systems make creating sophisticated projects fast and easy.

Computer Science & Information Technology

Which of the following is false about headers and footers?

What will be an ideal response?

Computer Science & Information Technology

Case Based Critical ThinkingCase 1You have created a very long web page. Answer the following questions about the navigation structure for this web page. Which of the following would you create to help users navigate the web page?

A. External links B. Internal links C. A link checker D. A pdf version of the web page

Computer Science & Information Technology

Case 2You want to include a video in your application. Answer the following questions about using video. Which of the following is where you manage the video you place in your application?

A. The Video Panel B. The Multi-Object Panel C. The Media panel D. The Images panel

Computer Science & Information Technology