Difference between Color.red and Color.RED

There’s the code itself:

public final static Color red = new Color(255, 0, 0);

public final static Color RED = red;

The upper case letters were introduced in JDK 1.4 (to conform to its naming convention, stating that constants must be in upper-case).

In essence, there are no difference at all (except letter casing).


If I want to really be brave, Oracle might go wild and remove constants that is lower-cased, but then that would break all other code that’s written pre-JDK 1.4. You never know, I would suggest sticking to uppercase letters for constants. It first has to be deprecated though (as mentioned by Andrew Thompson).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)