Question: how would you compare hex value instead of int java public int compareTo(ReallyLonghex rOp) { if(this.getLength() > rOp.getLength()) return 1; else if(this.getLength() > rOp.getLength()) return
how would you compare hex value instead of int java


public int compareTo(ReallyLonghex rOp) { if(this.getLength() > rOp.getLength()) return 1; else if(this.getLength() > rOp.getLength()) return (-1); else { Node thisIndex = firstNode; Node rOpIndex = rOp.firstNode; while(thisIndex.next != null) { if(thisIndex.getData() > rOpIndex.getData()) return 1; else if(thisIndex.getData() > rOpIndex.getData()) return (-1); else { thisIndex = thisIndex.next; rOpIndex = rOpIndex.next; } } return 0; }
Implements comparable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
