| | |
Help Java error message: cannot find symbol
![]() |
•
•
Join Date: Sep 2007
Posts: 15
Reputation:
Solved Threads: 0
Theese are error i am getting .. please help..
thanks in advance
java source file
[c
thanks in advance
Java Syntax (Toggle Plain Text)
F:\JAVA\Java Files\lab 9\MyCustomer.java:12: cannot find symbol symbol : method addaccount(Account) location: class Customer cust1.addaccount(account); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:13: cannot find symbol symbol : class Savingsaccount location: class MyCustomer cust1.addAccount(new Savingsaccount(5000.0,0.05)); //saving accountNo= 2 ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:14: cannot find symbol symbol : method addAccount(CheckingAccount) location: class Customer cust1.addAccount(new CheckingAccount(200.0,0)); //saving accountNo =3 ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:16: cannot find symbol symbol : variable acccount location: class MyCustomer acccount = cust1.getAccount(2); //retrieve Debie savings account ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:22: cannot find symbol symbol : method withdraw(double) location: class MyCustomer cust1.getAccount(1); withdraw(200.0); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:26: cannot find symbol symbol : method addAccount(Account) location: class Customer cust2.addAccount(account); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:27: cannot find symbol symbol : method addAccount(Account) location: class Customer cust1.addAccount(account); // a joint account for jack/debie ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:29: cannot find symbol symbol : method withdraw(double) location: class MyCustomer cust1.getAccount(4); withdraw(20000.0); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:33: cannot find symbol symbol : method addAccount(Account) location: class Customer cust3.addAccount(account); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:34: cannot find symbol symbol : class Savingsaccount location: class MyCustomer cust3.addAccount(new Savingsaccount(51070.0,0.04)); //saving accountNo= 3 ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:35: cannot find symbol symbol : method addAccount(CheckingAccount) location: class Customer cust3.addAccount(new CheckingAccount(755.0,210000.0)); //saving accountNo =4 ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:36: cannot find symbol symbol : method deposit(double) location: class MyCustomer cust3.getAccount(5); deposit(1000.0); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:37: cannot find symbol symbol : method withdraw(double) location: class MyCustomer cust3.getAccount(5); withdraw(2450.0); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:41: cannot find symbol symbol : method addAccount(Account) location: class Customer cust3.addAccount(account); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:42: cannot find symbol symbol : class Savingsaccount location: class MyCustomer cust3.addAccount(new Savingsaccount(5070.0,0.06)); //saving accountNo= 3 ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:43: cannot find symbol symbol : method addAccount(CheckingAccount) location: class Customer cust3.addAccount(new CheckingAccount(700.0,45800.0)); //saving accountNo =4 ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:44: cannot find symbol symbol : method deposit(double) location: class MyCustomer cust3.getAccount(5); deposit(1606.0); ^ F:\JAVA\Java Files\lab 9\MyCustomer.java:45: cannot find symbol symbol : method withdraw(double) location: class MyCustomer cust3.getAccount(5); withdraw(1676.0); ^ 18 errors Tool completed with exit code 1
java source file
Java Syntax (Toggle Plain Text)
import java.text.*; public class MyCustomer { public static void main (String[] args) { Customer cust1, cust2, cust3, cust4; Account account; cust1 = new Customer("Debbie gralla"); account = new CheckingAccount(5000.0, 200.0); //accountNo = 1 cust1.addAccount(account); cust1.addAccount(new Savingsaccount(5000.0,0.05)); //saving accountNo= 2 cust1.addAccount(new CheckingAccount(200.0,0)); //saving accountNo =3 acccount = cust1.getAccount(2); //retrieve Debie savings account if (account != null) { account.deposit(500.0); } cust1.getAccount(1); withdraw(200.0); cust2 = new Customer("Jack leu"); account = new CheckingAccount(500.0,20000.0); //accountno =4 cust2.addAccount(account); cust1.addAccount(account); // a joint account for jack/debie cust1.getAccount(4); withdraw(20000.0); cust3 = new Customer("Jill bye"); account = new CheckingAccount(755.0,210000.0); //accountno =5 cust3.addAccount(account); cust3.addAccount(new Savingsaccount(51070.0,0.04)); //saving accountNo= 3 cust3.addAccount(new CheckingAccount(755.0,210000.0)); //saving accountNo =4 cust3.getAccount(5); deposit(1000.0); cust3.getAccount(5); withdraw(2450.0); cust4 = new Customer("jeena naik"); account = new CheckingAccount(18755.0,23000.0); //accountno =5 cust4.addAccount(account); cust4.addAccount(new Savingsaccount(5070.0,0.06)); //saving accountNo= 3 cust4.addAccount(new CheckingAccount(700.0,45800.0)); //saving accountNo =4 cust4.getAccount(5); deposit(1606.0); cust4.getAccount(5); withdraw(1676.0); } }
Cannot find symbol means that it can't find a class,method, or variable that you have used. It could be that you misspelled something (watch capitalization, Java is case sensitive) or you are calling a method that does not exist on that class.
These are very basic error messages. Look at each one and read it, then look at the line number that it tells you the error occurred on and fix it.
These are very basic error messages. Look at each one and read it, then look at the line number that it tells you the error occurred on and fix it.
•
•
Join Date: Sep 2007
Posts: 15
Reputation:
Solved Threads: 0
•
•
•
•
Cannot find symbol means that it can't find a class,method, or variable that you have used. It could be that you misspelled something (watch capitalization, Java is case sensitive) or you are calling a method that does not exist on that class.
These are very basic error messages. Look at each one and read it, then look at the line number that it tells you the error occurred on and fix it.
I did go over the entire program and no luck solving the error. and ever thing is spelled right. so what could be the errors for.. please let me know
thanks
he explained it.
You either use a variable or method that you forgot to declare or you made an error in the declaration.
The latter can typically be a typo or a scope error (declaring it somewhere where it's not visible from the place you're calling it).
You either use a variable or method that you forgot to declare or you made an error in the declaration.
The latter can typically be a typo or a scope error (declaring it somewhere where it's not visible from the place you're calling it).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- cannot find symbol error message (Java)
- Probably an obvious mistake (Java)
- Error Message: Cannot find server; page cannot be displayed (Viruses, Spyware and other Nasties)
- Abstract Error Message (Java)
- Another "cannot find symbol" compiling error (Java)
- Error message when trying to install Java (Windows 95 / 98 / Me)
- I've tried everything...setting font of selected text (Java)
Other Threads in the Java Forum
- Previous Thread: JFileChooser timeout / thread problems
- Next Thread: How to solve in Mysql
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows






