Dynamic Designs Blog

— Java Constants

Posted December 10th 2009 by Aaron in JavaComments (0)

A constant in java is a variable with a pre-defined value. To declare a variable as a constant, use the final modifier:

public static final int VARIABLENAME = 0;

VARIABLENAME can’t ever be assigned to a different value.

The full name for this declaration is an enumerated constant.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment