Below is the code I’ve to use toString(int[]) method:
int[] array = new int[lnr.getLineNumber() + 1];
int i = 0;
System.out.println(array.toString());
This is the output I get:
[I@23fc4bec
It doesn’t give me the desired output as I want a list of the array's elements, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ``, " (a comma followed by a space). Can anyone tell me how to do this?