im making a 3x3 array filled with random numbers and im supposed to find the largest number in the array , i compiled my code and its working fine but i dont think im getting the right answer here's my code , any help will be greatly appreciated
public class matriz_mayor{ public static void main(String args[]){ int may, r, c; int [][] v; v = new int [3][3]; for(r=0;r<=2;r++){ for(c=0;c<=2;c++){ v [r][c] = new Double(Math.random() *10).intValue(); System.out.println("["+v[r]+"]" + "["+v[c]+"]"); } may = v[0][0]; for(r=0;r<=2;r++){ for(c=0;c<=2;c++){ if(v[r][c]>may){ may = v[r][c]; } }System.out.println("El numero mayor es" + may); } } } }run: [[I@190d11][[I@190d11] [[I@190d11][[I@a90653] [[I@190d11][[I@de6ced] El numero mayor es7 El numero mayor es7 El numero mayor es7 BUILD SUCCESSFUL (total time: 0 seconds)