• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Erm.. Weird compile errors.

 
Accela Moon
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any syntax errors? I keep getting these 3 compilation errors.

C:\Documents and Settings\Moon\My Documents\Navi Projects\School\OOPJ Project\Prototype\GPS-Lite v2 Alpha\appinterface.java:115: <identifier> expected
boolean validity;
^
C:\Documents and Settings\Moon\My Documents\Navi Projects\School\OOPJ Project\Prototype\GPS-Lite v2 Alpha\appinterface.java:129: orphaned case
case 2:
^
C:\Documents and Settings\Moon\My Documents\Navi Projects\School\OOPJ Project\Prototype\GPS-Lite v2 Alpha\appinterface.java:231: ')' expected
acceptDbConnection("INSERT INTO Receiver (rev_id, location, validity, timedate) VALUES (" + this.receiverId + ", " + location + ", " + validity + dateTime")" + );
^
3 errors
[ April 11, 2004: Message edited by: Accela Moon ]
 
Accela Moon
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ April 11, 2004: Message edited by: Accela Moon ]
[ edited to format code and to break apart many long lines -ds ]
[ April 11, 2004: Message edited by: Dirk Schreckmann ]
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. This needs a ;
2. You have unmatched { } starting at case 1
3. There is an error near the end of this line
[ edited to break long code line -ds ]
[ April 11, 2004: Message edited by: Dirk Schreckmann ]
 
sever oon
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your braces are all messed up. You have scopes with nothing in them, etc. This is the danger of not following a sensible coding style. You need to decide what format you want to use for your code, and then apply it consistently so you can see those type of problems and avoid them as you write...and besides that, when you need help, your code will be readable enough for people like me to provide it.
sev
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Accela!
Concerning your question as to whether you have any syntax errors, the answer is, "Yes! You have a lot of them!"
When you're interpretting your the errors output by your compiler, a good way to approach things is to just pay attention to the first compiler error. Fix it, and then fix the first of any subsequent errors. Repeat until the compiler stops complaining.
Also, in my experience, development life is a lot easier if you've never more than one or two problems to deal with at a time. So, don't write almost 500 lines of code with lots of compiler/syntax errors as you've done here. It's a big mess to deal with. Instead write a line or two. See if they compile. If they don't, fix them. Repeat as necessary.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, your first compiler error is on the line that reads
if (this.userName == userName && this.passWord == passWord)
because your appinterface class doesn't define an instance member passWord.
Fix this problem first, then tackle the next one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic