Multiple choice technology programming languages

Check whether the syntax of the piece of code is correct: text.setBackGround(color.Yellow);

  1. True

  2. False

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

The syntax is incorrect. In Java (AWT/Swing) or C#, method names and property values are case-sensitive. The correct method name is setBackground (lowercase 'g') and the predefined color object is Color.yellow or Color.YELLOW (capital 'C', lowercase/uppercase yellow).