up previous next contents
Next: Reserved keywords Up: Variables, constants, and keywords Previous: Literals   Contents

Constants

  • Constants are variables whose value does not change during the life of the object.
  • Java does not have a constant keyword.
  • In Java you define a constant like this:
      static final String name = "John Jones";
      static final float pi = 3.14159;
    


up previous next contents
Next: Reserved keywords Up: Variables, constants, and keywords Previous: Literals   Contents