•/* Sample program to
write "Hello World" */
•class HelloWorld {
• // No data declarations in this
class
• public
static void main(String[] arguments) {
• System.out.println("Hello
World !");
• }
•}
Three different formats for comments:
• C-style comments, delimited by /* and */
• C++ style single-line comments, starting with
//
• documentation comment, to extract comment
into a machine-generated document