Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Generative Artificial Intelligence For Project Management With Aws

Authors: Timothy Krimmel

1st Edition

B0CQV9KWB8, 979-8872627197

More Books

Students also viewed these Databases questions

Question

2 7 8 .

Answered: 1 week ago

Question

Persuading Your Audience Strategies for

Answered: 1 week ago