English subtitles

← Commenting the Public Interface Part 1 - Intro to Java Programming

Get Embed Code
7 Languages

Showing Revision 4 created 05/25/2016 by Udacity Robot.

  1. Okay, let's see how one would write such a comment. The method is called
  2. addGas. And we need to describe it's purpose in plain English. So, just say
  3. Adds gas to the tank of this car. The method has a parameter, and for every
  4. parameter, we'll need an @param clause. Put in the name of the parameter, and
  5. then a description. The amount of gas to add. Do we need a @return clause? No,
  6. because this method, returns void. That's the Java.comment. When you generate
  7. the documentation again, now the comment is included in the webpage.