I have an array of objects but when i traverse throught it to display its contents, it gives an error, but only if it is not full. Any suggestions? Below is the code snippet:
for (int k = 0; k < array.length; k++)
{
msg += String.format(array[k].toString());
}
JOptionPane.showMessageDialog(null, msg);