Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 comparableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started