|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Getting compile errors!!!
Hello
i've been trying to compile this class but for some reason it keeps giving me errors. At first the error was class or interface required, which i managed to fix and now im getting other errors. Can neone help please:::: Code:
package Bank;
import java.io.*;
public class Bank
{
/*arrays created and initialised*/
Array accountList[] = new Array[21];
Array costumerList[] = new Array[21];
public String bankName = "The World Ban''K''";
/*public SavingsAccount (String ACCOUNTNUMBER)
{
}*/
public void bankName(String bankName)
{
this.bankName = bankName;
}
/*accessor method*/
public void getBankName()
{
return bankName;
}
/*public String getAccounts(accountList[])
{
for (int i=0;i<=20;i++)
{
return accountList[i];
}
}
public String getCustomers(costumerList[])
{
for (int i=0;i<=20;i++)
{
return costumerList[i];
}
}*/
/*mutator methods*/
public void creditAccount()
{
balance = balance + credit;
}
public void debitAccount()
{
if(balance >= 0){
balance = balance - debit;
}
}
/*accessor/print method*/
public void printCustomers() {
for (int i=0;i<=20;i++)
{
System.out.println(costumerList[i]);
}
}
public void printAccounts() {
for (int i=0;i<=20;i++)
{
System.out.println(accountList[i]);
}
}
/*public void printAccountCostumer() {
for (int i=0;i<=20;i++)
{
System.out.println(costumerList[] + accountList[i]);
}
}*/
public static void tui() {
System.out.println("welcome to The Ban''K'''s database");
System.out.println("\n Please select from the available options \n");
System.out.println(" 1. View existing accounts");
System.out.println(" 2. View existing account holders");
System.out.println(" 3. View existing accounts and their ownerships");
System.out.println(" 4. Search for a costumer");
System.out.println(" 5. Add a new costumer and create a new account for them");
System.out.println(" 6. Exit system");
}
public static void main(String[] args) {
char choice = '0';
do {
showMenu();
try {
choice = (char) System.in.read();
} catch (IOException e) {
}
switch (choice) {
case '1':
printAccounts();
break;
case '2':
printAccountHolders();
break;
case '3':
printAccountAndOwnership();
break;
case '4':
System.out.println("Input the costumer's costumer ID");
printAccountHolder();
break;
case '5':
createAccount();
break;
case '6':
system.exit(0);
break;
}
} while(choice >'0' && (choice < '7');
}
public String toString()
{
return "Account number: " + ACCOUNTNUMBER + "Account holder: " +
ACCOUNTHOLDER + " Account balance: " + balance + " Interest rate: "
+ interestRate;
}
}
|
|
#2
|
|||
|
|||
|
Where or what is the error your getting?
It would help if you posted it, as it contains important data such as the line where is happening. I'm not trying to be hard on you, but for example, if you have a class called Array, then you are going to get different errors than me, since I don't have a class called Array. Code:
Array accountList[] = new Array[21]; Array costumerList[] = new Array[21]; Last edited by daniel_g : December 17th, 2006 at 12:03 AM. |
|
#3
|
|||
|
|||
|
If anything, you're being reasonable to ask for the actual compile errors. Nobody will read through that code to look for errors. That's what compilers are for!
Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Getting compile errors!!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|