File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Color class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Color class" Watch "Color class" New topic

Color class

prakash rebala

Joined: Jan 18, 2001
Posts: 2
Why in Color class colors like blue, red, green are used as, and Color,green instead of Color.BLUE,
Color.RED and Color.GREEN as they are static and final as per
convention any specific reason
Peter Tran

Joined: Jan 02, 2001
Posts: 783
The only answer I can see is that someone else wrote the Color class and didn't follow the coding standard.
bhooshan iyer

Joined: Jan 13, 2001
Posts: 10
beats me!!!

[This message has been edited by bhooshan iyer (edited January 18, 2001).]
Marius Holm
Ranch Hand

Joined: Sep 11, 2000
Posts: 84
There is a sensible answer to this that I've read before, but I don't remember. But it is not an error or a convention violation.
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
hi ,
just guessing....but can it be because red/green/blue... are not primitive/String variables instead they are instances of Color class.
Marius were u talking about this link...?

looking forward for a right answer
prakash rebala

Joined: Jan 18, 2001
Posts: 2
Search at java did give answer to the question at - size 0.3K - Forums
but the link has expired
I agree. Here's the link:
subject: Color class
It's not a secret anymore!