Java noob returning a number help

Associate
Joined
19 Jul 2006
Posts
1,847
Think this is a fairly easy solve but i cant do it

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
 
Thanks Garee but i get lots of red lines with that code :(

Code:
public Maxnumber()
   {
      this.numbers = {1,5,-9,12,-3,89,18,23,4,-6};
   }

Think this maybe the culprit illegal start of expression?
 
Back
Top Bottom