Hi every body ..
i got these problems with my code
when ever i choose "no" as an answer .. it requires me to create an a count while i don't want to create one ..
another problem occurs when i use the Acounte_Number to be the ID for the user .. which is a private variable in another class ..
like this ..
class Acount
{
static String name;
static int ID;
private int Account_Number;
static double amount;
public double balance;
static Acount S[]=new Acount[100];
public Acount(String name, int ID , int Account_Number,double amount,double balance )
{
this.Account_Number=Account_Number;
this.amount=amount;
this.balance=balance;
}
//*********************************************************************
public int getAccount_Number()
{
return Account_Number;
}
public void setAccount_Number(int x)
{
Account_Number=x;
}
when ever i used it an exception occur .. something else the Acount_Number dose not increase ..
how can i fix that ..
thanx for any replay ..
public void creatAccounts(String name,String Gender, int Age, int ID,double balance,Adress AD,Acount AC )
{
String s="yes";
int i=0;
AC.setAccountNumber(i);
array [size]= new client( name, Gender, Age, ID, balance, AD, AC);
s=JOptionPane.showInputDialog("Do you Want to Creat New Acount ?(yes/no)","CREAT_ACOUNT");
if(s!="no")
{
while(size!=100)
{
if(AC.getAccountNumber()<array.length)
{
CREAT(AC.getAcount_Number)
JOptionPane.showMessageDialog(null,"creatAccounts Successfully");
}
size++;
Acount.setAcount_Number(i++);
break;
}
JOptionPane.showMessageDialog(null,"ID : "+ID);
}
else
{JOptionPane.showMessageDialog(null,"Full Array Max(100)");}
}
}