Java Compilation Errors

This quiz will help you recognize common compilation errors. Usually, IDEs are powerful enough to capture such errors on the fly. However, it is very important to know them by heart as you may be in a situation using only Javac and you do not want to waste a lot of time

download Export
search_insights Statistics
stylus_note White Board
Quran
calculate Calculator
dictionary Dictionary
fullscreen Full Screen

QUESTION OF
Views #: 658
Questions #: 4
Pass Score: 80.0%
Style
Mode

Which method will give a compilation error?

1 pts
volume_mute
(a)
public boolean isRich(int money) {

   if (money != 0)
     return true;
   else 
      return false;
}

(b)
public boolean isRich(int money) {

   if (money != 0)
     return true;

}
note_alt Add notes
flag Flag

Correct Answer

Explanation

What is the error message that the compiler will show if a semi-colon is missing?

1 pts
volume_mute

System.out.println("Line has " + num + " chars.")

note_alt Add notes
flag Flag

Correct Answer

Explanation

Does Javac compiler generate .class file even if there is a compile error?

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

What are the number of compilers Java had before Java 8?

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation