For example, I have an array of type int and size 3, it has elements 1, 2, 3 When I try to print it in JOptionPane with loops, it makes three different panes.
When I try:
JOptionPane.showMessageDialog( null, array );
It gives garbage values.
I have searched everywhere but I couldn’t find a solution. How do I display the array in an option pane?
Use
Arrays.toString ()as :