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

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

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 /7 Instance variables are inherited. You may not add any new instance variables // Default constructor private ReallyLongHex ) super ) // Note that we are adding the digits here in the END. This results in the MOST significant digit first in the chain. // It is assumed that Strings isa valid representation of an 7 unsigned integer with no leading zeros. public ReallyLongHex (String s) super ) char c: Iterate through the String, getting each character and adding it // at the end of the list for (int i = 0; i /7 Instance variables are inherited. You may not add any new instance variables // Default constructor private ReallyLongHex ) super ) // Note that we are adding the digits here in the END. This results in the MOST significant digit first in the chain. // It is assumed that Strings isa valid representation of an 7 unsigned integer with no leading zeros. public ReallyLongHex (String s) super ) char c: Iterate through the String, getting each character and adding it // at the end of the list for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!