aspose file tools*
The moose likes Beginning Java and the fly likes Compiling Errors - Help please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiling Errors - Help please" Watch "Compiling Errors - Help please" New topic
Author

Compiling Errors - Help please

Joe Grimp
Greenhorn

Joined: Apr 02, 2006
Posts: 15
When i compile my piece of code i get the following errors -

C:\jexp>javac banktest.java
banktest.java:182: cannot find symbol
symbol : method getType()
location: class BankAccount
if(getType())
^
banktest.java:184: cannot find symbol
symbol : method getAmount()
location: class BankAccount
return currentBalance - getAmount();
^
banktest.java:190: cannot find symbol
symbol : method getType()
location: class BankAccount
if(!getType())
^
banktest.java:192: cannot find symbol
symbol : method getAmount()
location: class BankAccount
return currentBalance + getAmount();
^
banktest.java:192: operator + cannot be applied to double,getAmount
return currentBalance + getAmount();
^
banktest.java:192: incompatible types
found : <nulltype>
required: double
return currentBalance + getAmount();
^
banktest.java:207: cannot find symbol
symbol : method readDate()
location: class Transaction
list[i].readDate();
^
7 errors


Here is the code -



How can i fix these errors? Thanks.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
You have to add methods getType() and getAmount()
Joe Grimp
Greenhorn

Joined: Apr 02, 2006
Posts: 15
If i added these to my code would it solve the errors?

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Well... no, because you haven't got member variables named "type" or "amount". You've got a "currentBalance", however, which I suspect is what "amount" is intended to be. I think you need to take a step back and look at things. Where are you getting the idea to call these nonexistent methods from, anyway?


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiling Errors - Help please