A good answer might be:
|
Syntax ErrorsIt is likely that you will do something wrong. Here is the sample program with a deliberate error:
The required word "class" has been changed to "Class"
with a capital "C".
This is called a syntax error.
A syntax error is a "grammatical error" in using the programming language.
Here is what happens when the mistaken program is compiled:
The compiler tried to translate the source code into bytecode but got confused when it got to a captial "C" it did not expect. The error message is not very clear. They never are. But at least it shows where the compiler got confused. The compiler will not have created a new bytecode file because it stopped translating when it got to the error.C:\Temp>javac Hello.java compiling: Hello.java Hello.java:1: Class or interface declaration expected. Class Hello ^ 1 error |
QUESTION 5:To fix this error and run the program what must you do? Click Here after you have answered the question |