Friday, September 27, 2013

Exercise no. 27

package lord1;

import java.util.Arrays;

import javax.swing.JOptionPane;

public class sort {
   
    public static void main(String[] args) {
       
        String [] names = {"Lord","Welhim","Mitch","Lucker"};

        String output = "";

        Arrays.sort(names);


        for ( String name: names ){

            output = output+"\n"+name;

        }

        JOptionPane.showMessageDialog(null, output);

    }

}

No comments:

Post a Comment