SwingTopDebugging Tips

Debugging Tips

  1. Plan ahead.
  2. Write and test your programs incrementally.
  3. Localize the problem.

    We looked at the following program and saw how to find where the errors were and how to fix it.

    Demo: BadBasketball

  4. The use of "System.out.println" to print out vaiues while the program is executing.

    It can be used like:

        System.out.println("Print this line of text");
    
    or
    System.out.println("Score in Big Hoop test is " + score);
    

    Be prepared to use this trick while working on upcoming labs. It can be quite helpful.


SwingTopDebugging Tips