+ 1

How can I stop seeing the address of my array?

import java.util.Scanner; public class method1 { public static void main(String[]args) { Scanner scanner= new Scanner(System.in); int m=scanner.nextInt(); int n=scanner.nextInt(); int [][] print1=new int [m][n]; System.out.print(zarb(m,n,print1)); scanner.close(); } static int[][] zarb (int m,int n ,int [][] print1) { for(int i=0;i<m;i++) { for ( int j=0;j<n;j++) { print1 [i][j]=i*j; System.out.print(print1 [i][j]+" "); } System.out.println(); } return print1; } }

28th Jan 2022, 9:35 AM
Dorsa
2 ответов
+ 1
Don't return anything.. Set return type void And in main, call method as just zarb(m,n,print1)
28th Jan 2022, 9:45 AM
Jayakrishna 🇮🇳
+ 1
Thanks a lot for your help
28th Jan 2022, 11:52 AM
Dorsa