What are the color values given by the drawString method of the above program ?
ID: 3539517 • Letter: W
Question
What are the color values given by the drawString method of the above program ?
a) 127, 127, 127 b) 0.5, 0.5, 0.5 c) depends on the underlying system d) does not compile as the program is error prone e) none
- See more at: http://way2java.com/java-questions/test-your-java-8/#sthash.sKVeFGKc.dpuf
import java.awt.*; class GetColorValues extends Frame { private float red = 0.5f, green = 0.5f, blue = 0.5f; public void paint(Graphics g) { g.setColor(new Color(red,green,blue)); g.drawString(g.getColor().toString(), 50 ,75); } public static void main(String args[]) { Frame f = new numbers(); f.setVisible(true); f.setSize(300,300); } }
Explanation / Answer
a
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.