Java Color.toString()
Syntax
Color.toString() has the following syntax.
public String toString()
Example
In the following code shows how to use Color.toString() method.
import java.awt.Color;
// w w w.j a va 2 s . c o m
public class Main {
public static void main(String[] args) {
Color myColor = Color.RED;
System.out.println(myColor.toString());
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »