Question: Consider the class definition on the left. Complete the implementation of the equalsmethod. The two Colorobjects are equal, if their hexadecimal values are the same
Consider the class definition on the left. Complete the implementation of the equalsmethod. The two Colorobjects are equal, if their hexadecimal values are the same (ignoring the case). public class Color private String hexValue; private String name; public Color ( String hex, String name ) { this.hexValue hex; this.name = name; } public Color (String name) { this.hexValue = null; this.name = name; 2 @Override public boolean equals (Object obj) { // please implement your method here Fdsf... public String toString of return name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
