Think this is a fairly easy solve but i cant do it
No matter what i put after the System.out.println(step1.****);
I cant get a proper number, I dont need to us a toSting thing do I as its already an int.
TIA
Code:
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Maxnumber step1;
step1 = new Maxnumber();
System.out.println(step1.????)
}
}
Code:
import java.util.Arrays;
public class Maxnumber {
int numbers[]= {1,5,-9,12,-3,89,18,23,4,-6};
public int maxValue(int[] numbers){
int x = 0;
Arrays.sort(numbers); //sort the array into order
x = numbers[numbers.length-1];
return x;
// or return numbers[numbers.length-1];
}
}
No matter what i put after the System.out.println(step1.****);
I cant get a proper number, I dont need to us a toSting thing do I as its already an int.
TIA