Multiple choice

Which of the following statements about the given statement is correct? Color c1 = new Color(284,60,189);

  1. A new color will be created.

  2. runtime Exception

  3. Parameters are not enough

  4. Compile time error : cannot find method color

  5. Compile time error : Color is Abstract cannot xreate an object.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct answer because color constructor creates a new color but it takes parameters in the range 0-255. But here the value passed is 284 (in first parameter). So, a runtime exception named “IllegalArgumentException” will be thrown by the JVM.