File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Color class

 
prakash rebala
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why in Color class colors like blue, red, green are used as
Color.blue, Color.red 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
Bartender
Posts: 783
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only answer I can see is that someone else wrote the Color class and didn't follow the coding standard.
 
bhooshan iyer
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
beats me!!!

[This message has been edited by bhooshan iyer (edited January 18, 2001).]
 
Marius Holm
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Marius
 
deekasha gunwant
Ranch Hand
Posts: 396
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...? http://www.javaranch.com/ubb/Forum24/HTML/003052.html

looking forward for a right answer
deeksha
 
prakash rebala
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search at java did give answer to the question at http://forum.java.sun.com/read/16787727/q_6L-7GZNZgAAAB9q#LR - size 0.3K - Forums
but the link has expired
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic