61.2k views
5 votes
If you misspell a word in your Java program, it may be true thatI. the program will not compileII. the program may compile but not runIII. the program may compile and run, but still have a logic errorA. I and II onlyB. I and III onlyC. II and III onlyD. I, II and III

1 Answer

4 votes

Answer:

The correct answer is D. I, II, and III.

Explanation:

Java is a strongly typed language, this means that it's case-sensitive and each variable needs to be defined. Furthermore, Java has a set of reserved words. If you misspell a word, depending on the error:

  • If you import a package and misspell the package reserved word, it won't compile.
  • If you misspell the main function, it will compile but not run.
  • If you misspell a function assigned for a variable, it may compile and run but when the program passes through the line of the code, it would throw a logic error.
User Rofrankel
by
4.7k points