Below is the code I’ve to use toString(int) method:
int array = new int[lnr.getLineNumber() + 1];
int i = 0;
This is the output I get:
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?