fork download
  1.  
  2. import java.awt.*;
  3.  
  4. class Example {
  5. public static void main (String[] args) {
  6. Color c = new Color(100, 100, 100);
  7. int argb = ( c.getAlpha() << 24 ) |
  8. ( c.getRed() << 16 ) |
  9. ( c.getGreen() << 8 ) |
  10. ( c.getBlue() );
  11. // this should print true
  12. System.out.println(argb == c.getRGB());
  13. }
  14. }
Success #stdin #stdout 0.14s 4390912KB
stdin
Standard input is empty
stdout
true