Reference no: EM132398963
1) Create Method To find the maximum value, use the following array and search through it to find the max value like we did in a previous assignment. This Method must return the Max Value to the calling method.
int[] findMax = {2, 5, 3, 9, 11, 8}
2) Write second method that accepts the maximum number from the method in #1 above as an argument and prints each number from 1 up to that maximum, inclusive, enclosed in square brackets. For example, if you passed 5 as an argument to the method, it would display:
[1] [2] [3] [4] [5]
You may name this method printNumbers.
Assume that any value passed to the method will be at least 1.
3) In your Main method you only need to call method1, which in turn calls method2.
Example:
public static void main(String[] args)
{method1;}
Submit:
language is java