以下程序是实现选择性的创建一个对象数组的一部分代码,在输出过程中使用Infprint()方法输出该对象数组,但是在输出过程中发现System.out.println("-----------------------------------------------------");/*就是这个不能输出,郁闷呀!*/  不能执行。能不能帮我看一下是怎么回事?学生不胜感激呀!import javax.swing.JOptionPane;
import java.lang.String;
public class testAccount extends JOptionPane { public static void main(String[] args) {
Account user1 = new Account();
Account user2 = new Account(1122,20000,0.045);
Account[] User = new Account[10];
Infprint(User);
/*选择性创建新的帐户*/
String judgeString = JOptionPane.showInputDialog(null,"Do you want create a new Account(Y/N)","chose dialog",JOptionPane.INFORMATION_MESSAGE);
if("y".equals(judgeString)){
int i = 0;
while(true){
User[i] =new Account();
String IDString = JOptionPane.showInputDialog(null,"input Id:","message dialog",JOptionPane.INFORMATION_MESSAGE);
User[i].setID(Integer.parseInt(IDString));
String BalanceString = JOptionPane.showInputDialog(null,"input Blance:","message dialog",JOptionPane.INFORMATION_MESSAGE);
User[i].setBalance(Double.parseDouble(BalanceString));
String AnnualInterestRateString = JOptionPane.showInputDialog(null,"input annualInterestRate:","message dialog",JOptionPane.INFORMATION_MESSAGE);
User[i].setAnnualInterestRate(Double.parseDouble(AnnualInterestRateString));
i++;
String flagStr = JOptionPane.showInputDialog(null,"Do you want create other Accounter?(Y/N)","inquire dialog",JOptionPane.INFORMATION_MESSAGE);
if("n".equals(flagStr))
break;
}
}
Infprint(User);
System.exit(0);
} public static void Infprint(Account[] user){
System.out.println("------------ INRFORMATION---------------");
System.out.println("Id\tAnnualInterestRate\tMonthlyInterest\tbalance");
for(int i = 0;i<Account.count;i++){
System.out.println(user[i].getID()+"\t"+user[i].getAnnualInterestRate()+"\t\t\t"+user[i].getMonthlyInterest()+"\t\t"+user[i].getBanlance());
}
System.out.println("-----------------------------------------------------");/*就是这个不能输出,郁闷呀!*/
}
}class Account{
private int id;
public static int count = 0;
private double balance,annualInterestRate;
public Account(){
id = 0000;
balance = 0000;
annualInterestRate = 0.00;
count++;
}
public Account(int id,double balance,double annualInterestRate){
this.id = id;
this.balance = balance;
this.annualInterestRate = annualInterestRate;
count++;
}
public int getID(){
return id;
}
public double getBanlance(){
return balance;
}
public  double getAnnualInterestRate(){
return annualInterestRate;
}
public void setID(int id){
this.id = id;
}
public void setBalance(double balance){
this.balance = balance;
}
public void setAnnualInterestRate(double annualInterestRate){
this.annualInterestRate = annualInterestRate;
}
public double getMonthlyInterest(){
return balance*annualInterestRate/12;
}
public void withdraw(double amount){
balance -=  amount;
}
public void desposit(double amount){
balance += amount;
}
}