public String show(int[] row)
{
for(int i = 0; i < row.length; i++)
{
JOptionPane.showMessageDialog(null, row[i]);
}
}
What is wrong with this code?
I just want to print an array which is given in the parameter.
You could change the return type to
void:Also, if you wish to display all elements in the array you could do:
If a return
Stringis needed the same approach can be used: