I have a program,but there is an error, please help me, thanks
program to include six string data (name of city), then do the sorting of the six cities data and print data before and after sorting. but in terms of input data strings, there is an error, please help, thank you
import javax.swing.JOptionPane;
public class city {
public static String []namecity(String i)
{
String []irawan=new String [i];
for(int k=0;k<i.length;k++ )
{
irawan [k] =JOptionPane.showInputDialog("Please enter name of city ["+k+"]: ");
}
return irawan;
}
public static void printcity(String []p)
{
for(int k=0;k<p.length;k++)
{
System.out.print(p[k] + " ,");
}
}
public static void main(String[] args) {
// TODO code application logic here
String [] hery = namecity("6");
printcity(hery);
}
}