我是java的初学者,我将如何根据用户输入按字母和数字顺序对以下内容进行排序。然后通过JOptionPane
显示排序结果? (顺便说一句,这是一个正常运作的数组?)
for (int i=0;i<loop2.length;i++) {
String [] staff = new String[7];
staff [1] = JOptionPane.showInputDialog(null,"Enter staff name: "+i);
staff [2] = JOptionPane.showInputDialog(null,"Enter staff address: "+i);
staff [3] = JOptionPane.showInputDialog(null,"Enter staff email: "+i);
staff [4] = JOptionPane.showInputDialog(null,"Enter staff salary: ");
JOptionPane.showMessageDialog(null, staff);
}