Color.toString() has the following syntax.
public String toString()
In the following code shows how to use Color.toString() method.
import java.awt.Color; // www . j av a 2s . co 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.