how can i print an array element using showMessageDialog

for(int k=0; k<aSiz; k++){
                  JOptionPane.showMessageDialog(null,"New Array is \n"+array[k]);
                    }

i dont want "New Array is" to be repeated......
tell me fast.....

Then use a separate String variable. In the for loop concatenate all the elements of the array into that String variable and then display that variable.
Initialize it outside the for loop. Give it value in the for loop. Then after the loop display it.

strArray += array[k] + ", ";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.