Question: Which of the following codes is used to display the string Hello World! at X=20 Y=50 location? Assume that g holds a Graphics object reference.

Which of the following codes is used to display the string “Hello World!” at X=20 Y=50 location? Assume that g holds a Graphics object reference.

(a) g.println( “Hello World!” );

(b) drawString( “Hello World!”, 20, 50 );

(c) g.drawString( 20, 50, “Hello World!” );

(d) g.drawString( “Hello World!”, 20, 50 );

Step by Step Solution

3.33 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

d gdra... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Advanced Java Programming Questions!