public class Hello {
static int[] findMinMax(int arr[], int n) {
int min=arr[0];
int max=arr[0];
int [] temp = new int[2];
for(int i=1; i<n; i++) {
if(arr[i]<min)
min = arr[i];
else if(arr[i]>max)
max = arr[i];
}
temp[0]= min;
temp[1]= max;
return temp;
}
public static void main(String[] args) {
int[] arr = {22, 3, 5, 7, 9, 16};
int[] result = findMinMax(arr, 6);
for(int i=0; i<2; i++)
System.out.print(result);
}
}
it gives output as [I@36baf30c[I@36baf30c
help me understand where I am wrong