Valid Identifiers

Purpose:

To name variables, class, methods, packages, interfaces.

Example:

myIdentifier

Usage:

  • Valid identifiers must be a letter followed by any number and combination of letters and numbers.
  • An identifier cannot be a keyword.
  • A class name must be unique to the package in which it is defined.
  • No two methods can have the same name and parameter list.
  • No two instance variables can have the same name.
  • No two local variables can have the same name, and a local variable cannot have the same name as an instance variable.
Back to the Table of Contents
email suggestions to: cs015tas@cs.brown.edu