Arrays in Java | Selenium Forum
D
divya khanna Posted on 12/08/2020

Hi Ashish ..Thanks for the previous reply.

When I run this 

int a[][]= {
{1,2,3,4},
{5,6,7,8},
{9,10,11,12}
};
System.out.println(a[1]);

 

The output I get is =[I@15db9742 whereas I assumed it will be {5,6,7,8}

However when I change it to System.out.println(a[1][2]); I get the right output which is =7

Please help

Thanks


A
Ashish Replied on 15/08/2020

a[1] is an array object

its not a number

so when you print it then it prints weird output


Related Posts