In this example of the Java programming language, there are three methods defined within the average class: fillarray() which returns an integer array, average() which returns an integer value and the main method which calls fillarray() and average() and displays the average of the values in the array.