Help on this Java error message. Part 1

Reply

Join Date: Sep 2007
Posts: 15
Reputation: java_starter is an unknown quantity at this point 
Solved Threads: 0
java_starter java_starter is offline Offline
Newbie Poster

Help on this Java error message. Part 1

 
0
  #1
Oct 31st, 2007
I am getting this error message please help me solve it
  1. F:\JAVA\Java Files\lab 9\MyCustomer.java:19: ';' expected
  2. account deposit(500.0);
  3. ^
  4. F:\JAVA\Java Files\lab 9\MyCustomer.java:26: ';' expected
  5. cust2 addAccount(account);
  6. ^
  7. F:\JAVA\Java Files\lab 9\MyCustomer.java:26: not a statement
  8. cust2 addAccount(account);
  9. ^
  10. F:\JAVA\Java Files\lab 9\MyCustomer.java:26: ';' expected
  11. cust2 addAccount(account);
  12. ^
  13. F:\JAVA\Java Files\lab 9\MyCustomer.java:27: ';' expected
  14. cust1 addAccount(account); // a joint account for jack/debie
  15. ^
  16. F:\JAVA\Java Files\lab 9\MyCustomer.java:27: not a statement
  17. cust1 addAccount(account); // a joint account for jack/debie
  18. ^
  19. F:\JAVA\Java Files\lab 9\MyCustomer.java:27: ';' expected
  20. cust1 addAccount(account); // a joint account for jack/debie

this is the java source file which the error is referring to

  1.  
  2. public class MyCustomer
  3. {
  4. public static void main (String[] args)
  5. {
  6. Customer cust1, cust2, cust3;
  7. Account account;
  8.  
  9. cust1 = new Customer("Debbie gralla");
  10. account = new CheckingAccount(5000.0, 200.0); //accountNo = 1
  11. cust1.addAccount(account);
  12. cust1.addAccount(new Savingsaccount(5000.0,0.05)); //saving accountNo= 2
  13. cust1.addAccount(new CheckingAccount(200.0,0)); //saving accountNo =3
  14.  
  15. acccount = cust1.getAccount(2); //retrieve Debie savings account
  16. if (account != null)
  17. {
  18. account deposit(500.0);
  19. }
  20.  
  21. cust1.getAccount(1); withdraw(200.0);
  22.  
  23. cust2 = new Customer("Jack leu");
  24. account = new CheckingAccount(500.0,20000.0); //accountno =4
  25. cust2 addAccount(account);
  26. cust1 addAccount(account); // a joint account for jack/debie
  27.  
  28. cust1.getAccount(4); withdraw(20000.0);
  29.  
  30. cust3 = new Customer("Jill bye");
  31. account = new CheckingAccount(755.0,210000.0); //accountno =5
  32. cust3.addAccount(account);
  33. cust3.addAccount(new Savingsaccount(51070.0,0.04)); //saving accountNo= 3
  34. cust3.addAccount(new CheckingAccount(755.0,210000.0)); //saving accountNo =4
  35. cust3.getAccount(5); deposit(1000.0);
  36. cust3.getAccount(5); withdraw(2450.0);
  37. }
  38. }
Last edited by java_starter; Oct 31st, 2007 at 12:27 pm.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,436
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 508
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is online now Online
Industrious Poster

Re: Help on this Java error message. Part 1

 
0
  #2
Oct 31st, 2007
It clearly says "not a statement". You need "."s between the object reference and methods to make those valid.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC