Java & JavaScript Color Quiz Test Your Java & JavaScript Skills: Beginner’s Quiz 1 / 5 Which Java method is used to set color in GUI applications (like Swing)? colorize() setTextColor() setColor() changeColor() 2 / 5 Which of the following is a valid way to set a color in JavaScript? element.color = “red” element.style.textColor = “red” setColor(“red”) element.style.color = “red” 3 / 5 Which format can be used to define colors in JavaScript? All of the above Hex code (#FF0000) Color names (“red”) RGB (rgb(255,0,0)) 4 / 5 In Java, which class is commonly used to represent colors in GUI applications? java.awt.Color javax.swing.Color java.lang.Color java.util.Color 5 / 5 Which JavaScript property is used to change the text color of an element? textColor fontColor backgroundColor color Your score isThe average score is 0% 0% Restart quiz Send feedback