wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Illeagal character and non statement errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Illeagal character and non statement errors" Watch "Illeagal character and non statement errors" New topic

Illeagal character and non statement errors

Ben Hultin
Ranch Hand

Joined: Aug 17, 2009
Posts: 135
I created this program but the errors I am getting all tell me that each line has the same two errors,

1. not a statement

2. Illegal characters 8221

From what I can see everything is fine for how the statments are set up. Maybe I need to declare all the variables in advance?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38045
What have you used to edit your code? If you use a word processor, you are liable to insert control characters which the compiler cannot parse. That might explain the illegal characters.
You haven't declared any of your variables in the code you posted. You have to declare every variable not later than the first occasion you use it.
Lee Kian Giap
Ranch Hand

Joined: Jan 23, 2008
Posts: 213
yes, you need to provide the type for those variable defined.

For example,
upForceOnEbyED = centerLoad/2 + roadWeight/2;

you need to add a type in front of upForceOnEbyED
int upForceOnEbyED = centerLoad/2 + roadWeight/2;

same for all other variable that you have not provide the type definition

I agree. Here's the link: http://aspose.com/file-tools
subject: Illeagal character and non statement errors
Similar Threads
please can you help to identify those errors
C and Java
Wanting to ask user to keep "inputting" at the command prompt until a condition is reached
this() or super() first line in constructors?
How to input user values multi-dimensional arrays