• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Error, error

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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






 
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what i am getting
java-error.PNG
[Thumbnail for java-error.PNG]
 
fred rosenberger
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 7126
185
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 99
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello



Hope with this, everything becomes more clear.

Regards,
M

 
fred rosenberger
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Marshal
Posts: 80745
486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic