Question: I have the integer = min and max working but how do I print them? Or how do I make my integer max into an
I have the integer = min and max working but how do I print them? Or how do I make my "integer max" into an actual int so I can be able to find the range and print it?
/** * Kyle Donohue * This program will have the user input the number of objects into a LinkedList * April 17th, 2018 */ import java.util.Scanner; import java.util.LinkedList; import java.util.ListIterator; import java.util.Random; import java.util.Collections;
public class hw2 { public static void main(String[] args) { LinkedList
*******************************
/* * Kyle Donohue * hw * * */ import java.util.Comparator; import java.util.List; public class integer implements Comparable
public integer(int r,int o) { random=r; original=o; } public int getoriginal(){ return original; }
public int getrandom(){ return random; } @Override public int compareTo(integer a){ if(a.random==this.random){ return 0; }else{ if(this.random>a.random){ return 1; }else{ return -1; } } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
