• Post Reply Bookmark Topic Watch Topic
  • New Topic

Redundant fields in Color class  RSS feed

 
Greenhorn
Posts: 15
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I were looking at the Color class here and I wonder why static fields are doubled.
Like yellow and YELLOW etc...
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The YELLOW (upper case)types were added in 1.4. Maybe it was done to confirm to the naming conventions and not break backward compatibility.
However, if you peek at the source code, you will find, the upper case points to the lower case!


 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maria Kowalczyk wrote:I were looking at the Color class here and I wonder why static fields are doubled.
Like yellow and YELLOW etc...

You know what? I have no idea. But does it really matter?

The ones with capital letters (which, I think, is the preferred convention for constants) seem to be newer, so maybe it was some form of standardization.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!