Archived

This topic is now archived and is closed to further replies.

[java] Should be an easy question

This topic is 5579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have three source files: Account.java CenteredFrame.java AccountApplication.java The first two compile without a problem, but when compiling the AccountApplication.java file, I get: AccountApplication.java:59: cannot resolve symbol symbol: class Account Account account = new Account(a,r); And the same kind of error for the CenteredFrame.java class. All the files are directly in the /src directory of the Java SDK. The reason I can''t figure out whats wrong is because in Account.java I have: public class Account { private int amount; private float rate; public Account( int a, float r ) { amount = a; rate = r; } public double getBalance( int time ) { return amount * Math.pow( 1 + ( rate / 100 ), time ); } } Which seems to me should have worked. What could be wrong?

Share this post


Link to post
Share on other sites
Tried it.....going more crazy. Would someone mind if I emailed the three files to you to see if they work on your machines? I'd be a huge help. Thanks.

Relpy to this post or just email me at: danman70@hotmail.com

[edited by - Mulligan on August 29, 2002 4:39:45 PM]

Share this post


Link to post
Share on other sites
Hey Mulligan, is that your surname?
My surname is Mulligan, where are you from?

dMDI

"I don''''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein

Share this post


Link to post
Share on other sites
OK. Email them to me at me@dmulligan.fsnet.co.uk, but it may be tomorrow evening (UK Time) before I am able to fix them.

dMDI

"I don''''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein

Share this post


Link to post
Share on other sites
compiled and ran fine. no problems.... it''s strange that you''ve problems.
The only thing i don''t understand is:
"All the files are directly in the /src directory of the Java SDK"
=> why did you put them there ?
(I''ve put all 3 in an independant folder and it compiled correctly.)

Share this post


Link to post
Share on other sites
They all had to be compiled at the same time. I had to type

"javac Account.java AccountApplication.java CenteredFrame.java"

I didn''t know that could be done, but now I''m good to go.

Share this post


Link to post
Share on other sites