CS2_06_Comments_Constants

CS2_06_Comments_Constants - CS2 • Module 6 • Category:...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS2 • Module 6 • Category: Elements of Java • Topic: Comments (including Javadoc)/Constants • Objectives – Introduce basic comments, Javadocs and constants CS 2 Introduction to Object Oriented Programming Module 6 Elements of Java Comments/Constants Documentation and Commenting • 70-80% of the cost of software is maintenance • Program code is written for two audiences – The compiler – The programmer and his colleagues who will need to understand the code after it is written EVEN IF IT WORKS • Comment to make your code clear! Documentation & Comments • Three ways to do it: // Double slashes comment out everything until the // end of the line /* This syntax comments out everything between the /* and the */. /* (There are no nested comments as in C++.) */ /** * This is syntax for Javadoc comments (similar to * the second style of commenting. It has tags which * allow for HTML formatting features. */ 1 2 3 More about Javadocs in a second More about Javadocs in a second 1. C-style comments with /* */; no nesting 2. C++ style comments beginning // 3. A unique "doc comment" starting with /** ...*/ Fun with comments: /*/ /* // */ /////////////////// /* ========= */ Some Comments on Comments Some Comments on Comments worthless Never closed Good for blocks Lesson: Comments should be helpful; don’t worry about compiler tricks with comment syntax.compiler tricks with comment syntax....
View Full Document

This note was uploaded on 01/23/2012 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Tech.

Page1 / 21

CS2_06_Comments_Constants - CS2 • Module 6 • Category:...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online