Choose the best option based on the following program:.
class Color { int red, green, blue; Color() {/*from ww w . j a v a 2 s. co m*/ this(10, 10, 10); } Color(int r, int g, int b) { red = r; green = g; blue = b; } String toString() { return "The color is: " + " red = " + red + " green = " + green + " blue = " + blue; } public static void main(String[] args) { // implicitly invoke toString method System.out.println(new Color()); } }
A.
no access modifier is specified for the toString()
method.
Object's toString()
method has a public access modifier; you cannot reduce the visibility of the method.
It will result in a compiler error.