Which of the following strategies is most effective when debugging a program?
-
A
Rewrite the entire program from scratch.
-
B
Insert System.out.println() statements at key points.
-
C
Avoid running the program until all code is written.
-
D
Use the Java compiler's error messages to identify syntax errors.