When you write a
Java method[
^] you can specify a return type - a type of value that the method passes back to the caller when it is finished. The return type can be anything: integer, double, boolean, a class you wrote: any single type name that you can put in front of a variable name when you declare it.
And the system then knows that you will provide a value when the method is called. To provide that value, you use the
return
statement supplying the value to return.
For example, a JAva method to add two numbers could be:
static int Add(int x, int y){
int result = x + y;
return result;
}
This takes two parameters called x and y both of which are integers, adds them together, and returns the resulting value.
Your need for a
return
in your code means you probably need a method which accepts an array of integers, and returns an integer:
static int GetBiggest(int[] arr){
int biggest;
...
return biggest;
}
All you need to do is fill in the code in the middle.