Comparing colors in java

import java.awt.*;

import java.awt.event.*;

import java.lang.Object;

import java.awt.Robot;

publicclass Robot04{

publicstaticvoid main(String[] args)throws AWTException{

Color UnkownColor =new Color(0, 102, 255);

Color greenn =new Color(0, 204, 51);

Color bluu =new Color(0, 102, 255);

If (UnkownColor = bluu) System.out.print(" the color is blue");

}

}

This doesn't successfully compare the unknown and blue color and neither does ==, How do I compare them?

[1113 byte] By [dfasdfsdafsadfasdfa] at [2007-11-27 2:25:43]
# 1

if(aColor.equals(otherColor)) { /* ... */ }

http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Color.html

= is the assignment operator;

== can be used to compare primitives;

.equals(...) is used to compare Objects for equality.

prometheuzza at 2007-7-12 2:34:23 > top of Java-index,Java Essentials,New To Java...
# 2
awesome thanks
dfasdfsdafsadfasdfa at 2007-7-12 2:34:23 > top of Java-index,Java Essentials,New To Java...