• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error, error  RSS feed

 
Adrian Martinez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, i keep getting error on this code but i can't figure out what the mistake is.

any help would be appreciated.

thank you






 
fred rosenberger
lowercase baba
Bartender
Posts: 12564
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the error you are getting? Is it a compiler error? runtime? what EXACTLY are you seeing that makes you think you have an error?

also note: it would help others greatly if you properly formatted your code. Remember, when asking for help, your job is to make it as easy as possible for others to do so.
 
Adrian Martinez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what i am getting
java-error.PNG
[Thumbnail for java-error.PNG]
 
fred rosenberger
lowercase baba
Bartender
Posts: 12564
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I can't read that. you should always try and fix the first error it gives first. Your screenshot shows there is an error that has rolled off the top.

It's better to post the text than a screenshot in any case. Please read this as to why.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12564
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I now see that is it pointing you to this line:



That isn't valid java. What are you trying to do there?
 
Knute Snortum
Sheriff
Posts: 4281
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like on line 25 you used ; when you should have used =.
 
Adrian Martinez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:It looks like on line 25 you used ; when you should have used =.


i think that might be it. let me try that.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12564
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think


will work either.

Again...I ask you...what are you TRYING to do on this line?

Here is another hint: look at the NEXT line after this and compare...
 
Adrian Martinez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:I don't think


will work either.

Again...I ask you...what are you TRYING to do on this line?

Here is another hint: look at the NEXT line after this and compare...



I think i see what you are saying.

cc setdollars (dollars);
cc setExchangrate (exchangerate)'

it was to set the dollars

and the line after to set the exchange rate.
 
Mauro Trevigno
Ranch Hand
Posts: 99
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello



Hope with this, everything becomes more clear.

Regards,
M

 
fred rosenberger
lowercase baba
Bartender
Posts: 12564
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adrian Martinez wrote:cc setdollars (dollars);
cc setExchangrate (exchangerate)'

Programming requires you to be precise. The compiler is unforgiving. You should get in the habit of being VERY careful what you type.

Neither of the above lines is valid java. The second isn't even what you have in your code. You have this:
not this
the first says "call the setExchangerate method on the object referred to by the cc variable, and pass it the value stored in the exchange rate variable". The second will throw a compiler error.

 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote: . . .
It's better to post the text than a screenshot in any case. Please read this as to why.
And this tells you how to do it.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!