Cannot find symbyl error
publicclass Bank{
Bank ()
{
List Accounts =new LinkedList();
Accounts.add(5000);
Accounts.add(15000);
int size = Accounts.size();
System.out.println(size);
}
publicvoid ShowAccounts (List list)
{
int size = list.size();
System.out.println("THere are :" + size +"elements in the list");
}
int ShowMenu ()
{
System.out.println("******************************************************************");
System.out.println("\nPLEASE ENTER YOUR CHOICE:\n\n");
System.out.println("Enter 100 \t To view all the accounts/To search for an account.");
System.out.println("Enter 0 \t To exit the application.");
System.out.println("******************************************************************");
Scanner scan =new Scanner(System.in);
int i=scan.nextInt();
//Creating an object account so I can refer to its methods
Account WAcc =new Account(100,1000);
switch (i)
{
case 100:
ShowAccounts( Accounts );
break;
case 0:
System.exit(1);
break;
}
ShowMenu();
return i;
}
publicstaticvoid main (String args[])
{
Bank FHB =new Bank();
FHB.ShowMenu();
}
Basically I have the code above and when I need to compile it, I get an error
Bank.java:94: cannot find symbol
symbol : variable Accounts
location: class Bank
ShowAccounts( Accounts );
In my logic (which is the logic of a beginner to java), everything is fine. Why is this error?
I am importing
import java.util.Scanner;
import java.util.List;
import java.util.LinkedList;
import java.util.ListIterator;
for the list creation

