File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Erm.. Weird compile errors. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Erm.. Weird compile errors." Watch "Erm.. Weird compile errors." New topic
Author

Erm.. Weird compile errors.

Accela Moon
Greenhorn

Joined: Apr 11, 2004
Posts: 20
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

Joined: Apr 11, 2004
Posts: 20

[ 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

Joined: Mar 13, 2004
Posts: 1272
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 ]

Mike Gershman
SCJP 1.4, SCWCD in process
sever oon
Ranch Hand

Joined: Feb 08, 2004
Posts: 268
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

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Erm.. Weird compile errors.