CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ

Java

Java Programming
Basic coding skills
Code comments

  • Comments are used to help document what a program does.
  • To code a single-line comment, type // followed by the comment. A single-line comment that's coded after a statement is sometimes called an end-of-line comment.
  • To code a block comment, type /* at the start of the block and */ at the end. You can also code asterisks to identify the lines in the block, but that isn't necessary.
  • A block comment that could be coded at the start of a program
    /*
     * Date:    6/27/2011
     * Author:  Hann So
     * Purpose: This program displays Hello World.
     */
     

Previous | Code statements | Code comments | Code identifiers | Declare a class | Declare a main method | Next