Getting Stuck
From Huben's Wiki
(Created page with "Everybody should be doing their own programming. You should be working until you are completely done, and never stopped. If you think you are done, ask if you have to do anythi...") |
|||
Line 8: | Line 8: | ||
If it is because of one of those cryptic compilation messages: | If it is because of one of those cryptic compilation messages: | ||
− | * Check [http://www.skylit.com/javamethods-old/JM-Appendix-B.html | + | * Check [http://www.skylit.com/javamethods-old/JM-Appendix-B.html Appendix B: Common Syntax Error Messages] |
* Make sure the following are balanced: {}, [], (), "", ''. Proper indentation really helps here! | * Make sure the following are balanced: {}, [], (), "", ''. Proper indentation really helps here! | ||
* Are you defining a variable where you should just be using it? System.out.println(int a); | * Are you defining a variable where you should just be using it? System.out.println(int a); | ||
Line 14: | Line 14: | ||
* Is there really a method of the class with that signature? | * Is there really a method of the class with that signature? | ||
* Are your methods within a class and your statements within methods? Methods in methods, classes within classes and so on are bad. | * Are your methods within a class and your statements within methods? Methods in methods, classes within classes and so on are bad. | ||
+ | |||
+ | If you are frustrated and can't figure out the message, you can ask a fellow student or me to help you find the error. Or, you can comment out pieces of the code until you find the problem. | ||
+ | |||
+ | Don't just throw away your code and start over: just comment it out if you want to start over. You may realize the error and wish you hadn't acted hastily. |