|Lecture 2||Slide 6||6.837 Fall '98|
Next to white space, the most important part of any Java program is comments. Keep in mind the syntax of a language is designed for communicating a program's design to a computer. Comments, on the other hand, are the primary mechanism for communicating a program's design to humans. Java has three types of comments.
answer = 42; // valid independent of the input
/* ... This next bit of code is so obvious that I hesitated to comment it a first. But, rather than risk any point reduction in this otherwise flawless program, I have decided to add this block comment with a recipe for a Gremolata garnish: 2 tablespoons of finely chopped parsley 1 minced clove of garlic ½ teaspoon of grated lemon rind Sprinkle this mixture on sauce, gravy, or computer programs during the last 5 minutes of preparation. */ question = "To be, or not to be".