Please enable JavaScript to use CodeHS

Chapter 5

Writing Classes

5.3 Documentation with Comments

Introducing Comments

Multi-line comments

Single line comments

Preconditions and postconditions

Power Class with Comments

Comments for Debugging

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Commenting Activity Tracker

Vocabulary

Term Definition
Preconditions Conditions that must be true prior to execution in order for that code segment to behave as expected.
Postconditions Conditions that must be true after the code segment is executed.

Do you have feedback on this lesson? Let us know here
Rate this lesson:

Feedback on this lesson:

Issue found (optional):