• Post Reply Bookmark Topic Watch Topic
  • New Topic

unexpected type  RSS feed

 
Ariana Abrenica
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having the error of "unexpected type"
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can’t help without more details. Which line? Which type? You have got some dreadful code style in that posting.
 
Ariana Abrenica
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:We can’t help without more details. Which line? Which type? You have got some dreadful code style in that posting.

I kind of fixed the problem. Thanks though
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you fix it? I hope you didn’t make the code style even worse.
 
Ariana Abrenica
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:How did you fix it? I hope you didn’t make the code style even worse.

by doing this
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot use assignments in the middle of print statements as you were doing in lines 10 - 14 of the code in the first post.

It happens very often on the forums here that someone gets an error (whether it is from the compiler or while running the program), and that they just post "I get an error! What is wrong with my code?".

you should realize that error messages contain a lot of detailed information that explains exactly what went wrong and where in the program it went wrong. Therefore, when you get an error, you should copy & paste the exact and complete error message - the more information you give, the quicker and better someone can tell you exactly what is wrong. And ofcourse it's very important to learn to understand error messages in detail, so that you can solve the problem yourself.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a lot better. You have seen the bad style and corrected it
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!