So after a few days and countless hours just today i have finished my little program but have some major flaws, I am not asking for answers but more of a guidance towards where I am suppose to be, I feel i am in the ball park concerning this but cant put 2 and 2 together. I will be up a couple more hours, and then again tommorrow after work but please feel free to lend a hand.
Here goes 78 errors of pure bliss according to Jcreator:
EDIT by mw: Added Code Tags. [ September 24, 2007: Message edited by: marc weber ]
You should seriously consider compiling as you go. Write a few lines, then compile. If you have errors, fix them when they're small. When it compiles without errors, then write a few more lines and compile again... And so on.
I think that's your best shot at debugging this code. Break it down to just a few lines, and gradually add more lines as you fix the errors. (As you do this, you will find that Java does not have an "endIf." Use braces for this. Also, "call" is not a keyword.)
PS: Please use Code Tags when posting code. Thanks! [ September 24, 2007: Message edited by: marc weber ]
If you have reproduced your code exactly here on this forum,I can see two mistakes for sure.
1) When you compile and try to run a java program,the execution of the program starts from main method.You have not defined a main method in your program.Of course that will not cause a compile time error.Absence of main method will not cause execution of the program at run time.
2) You entered--
private StagIO io = new StaugIO();
Apparently you are trying to create a new object of the class type StaugIO but on the left hand side you are defining object belonging to class type StagIO. You can do this only if StagIO is a superclass of StaugIO class.But from your code, it does not seem to be.
Most of those errors are pretty descriptive, telling you exactly what you're missing. I assume that they also provide a line number. So knowing what line is missing what... You just need to take one error at a time. If you can't figure them out, tell us exactly what error is happening at exactly which line in the code.
(Again: Neither "endIf" nor "call" are keywords in Java. These have no meaning and will cause errors.) [ September 25, 2007: Message edited by: marc weber ]
I have got it down to 15 errors but I really feel somethings I did werent right but it still let it pass when i compiled it. I dont understand the while part also the illegal starts and on line 56 i know I am completely lost because I cant even figure out where to place the ( ) at
while expected LINE 41 illegal start of expression LINE 42 not a statement LINE 52 '(' expected LINE 56 ')' expected LINE 56 not a statement LINE 56 ';' expected LINE 56 illegal start of type LINE 56 not a statement LINE 56 illegal start of expression LINE 65 'else' without 'if' LINE 168 <identifier> expected LINE 169 <identifier> expected LINE 170 class, interface, or enum expected LINE 181 class, interface, or enum expected LINE 196
I dont mean to be a bore but here is my program again with the only 15 errors:
[ September 25, 2007: Message edited by: Reno Madrigal ]
As Marc said, it's much easier for you to figure out what's going wrong, since you have the line numbers.
One thing I noticed is that you seem to assume that in a switch statement, execution of a case ends at the next case statement. That's not the case; if you want execution to stop at the next case statement, you need to insert a "break;" before it.
you have a "do" that is not followed by braces {}. that means that only one line belongs in the do-body. java is expecting a while after that one line. you probably need braces around a big chunk of code between your 'do' line and your 'while' line (which Ulf points out also needs correcting).
Post by:autobot
See where your hand is? Not there. It's next to this tiny ad:
a bit of art, as a gift, the permaculture playing cards