Question: JAVA: Can you help me fix this part program? NOT implement this method by converting the Name object to string (using to String()) and then


JAVA: Can you help me fix this part program?
NOT implement this method by converting the Name object to string (using to String()) and then using the String class compare To method on the resulting strings. public int compareTo (Name n ) \{ if(lastName.compareTo(n.getLastname ()) =0){ return lastName. compareTo(n.getLastname ()); \} if(firstName.compareTo(n.getFirstname ()) !=0){ return firstName.compareTo(n.getFirstname ()); \} if(middleName.compareTo(n.getMiddlename ()) =0){ return middleName.compareTo(n.getMiddlename ()); \} return 0; \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
