In: Computer Science
JAVA
Given the header of a method
public static void m1 (int[ ] max)
Write down Java codes to invoke m1 method, declare variables as needed, (Do NOT implement the method)
// PLEASE LIKE THE SOLUTION
// FEEL FREE TO DISCUSS IN COMMENT SECTION
// JAVA PROGRAM
//class for calling the method m1
class Test{
// method m1
public static void m1 (int[] max){
}
// now if the method is present in same class then
we can call by just name
// else if present in other class call by
classname.m1(arg)
public static void main(String arg[]){
// now test m1 call
// create array to pass
int a[] = new int[5];
// loop for storing values
for(int i=0;i<5;i++){
a[i] =
i+1;
}
// call
Test.m1(a);
}
}
// SAMPLE OUTPUT