[ Contact ] [ Links ] [ Previous : 5 / 29 : Java Specifics : space and curly braces ] [ Up ] [ Next : 7 / 29 : Special Comments ]

Comments

Next to white space, the most important parts of any Java program are its comments.

Inline comments:

	answer = 42; // valid independent of the input

Block comments:

/*
... This next bit of code is so obvious that I hesitated    
  to comment it a first. 
  For those whom intergalactic culture is limited,
  please refer to the textbook :  
  "the hitch hicker guide for the galaxy" by Douglas Adams.

  tip : 42 is the answer for life, the universe and everything
*/ 
	answer = 42;
   

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.

 


See the "Links" link above to find out the sources of the proposed informations
Pascal Vuylsteker / eScience / Computer Science / ANU
Last modified: 20/4/2004
TOC - Print
Send your comments at :
<Hugh.Fisher@anu.edu.au>