Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java Colors

  1. #1
    Junior Member
    Join Date
    Oct 2013
    My Mood
    Thanked 0 Times in 0 Posts

    Lightbulb Java Colors

    Just a simple question, I was wondering why Java includes both Color.black and Color.BLACK

    There's 0 difference between the two, why is one all caps and the other is not


    public static final Color black
    The color black. In the default sRGB space.

    public static final Color BLACK
    The color black. In the default sRGB space.
    Color (Java 2 Platform SE v1.4.2) - Quoted from here

  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    My Mood
    Thanked 167 Times in 158 Posts

    Default Re: Java Colors

    Since I am not the author of that class I have no idea.

    {stab in the dark}
    The BLACK variable was introduced in version 1.4, while the black variable was in the original class. Standard naming conventions have final (constant) variable names in all uppercase. That would be why they were introduced in a later version. But they could not remove the lowercase variables for backward compatibility reasons.
    Improving the world one idiot at a time!

  3. The Following User Says Thank You to Junky For This Useful Post:

    Ravekitty (October 11th, 2013)

Similar Threads

  1. Java3D - Colors mix up
    By Java3D_Noob in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 26th, 2012, 02:24 PM
  2. [SOLVED] Random Colors Problem
    By captain in forum What's Wrong With My Code?
    Replies: 11
    Last Post: February 23rd, 2012, 10:40 PM
  3. Need some help changing the colors of a picture
    By Methos in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 25th, 2012, 04:49 PM
  4. java grid and colors/graphics
    By ajmukon in forum What's Wrong With My Code?
    Replies: 10
    Last Post: January 25th, 2011, 03:38 PM
  5. Modify Colors in a Picture
    By theuniverse in forum Java Theory & Questions
    Replies: 0
    Last Post: October 17th, 2009, 04:49 PM

Tags for this Thread