Given a Graphics object g, to draw a polygon to connect points (3, 3), (4, 10), (10, 20), (2, 100), you use __.

Given a Graphics object g, to draw a polygon to connect points (3, 3), (4, 10), (10, 20), (2, 100), you use __________.


A. g.drawPolyline(new int[]{3, 4, 10, 2}, new int[]{3, 10, 20, 100}, 4)
B. g.drawPolyline({3, 4, 10, 2}, {3, 10, 20, 100}, 4)
C. g.drawPolygon(new int[]{3, 4, 10, 2}, new int[]{3, 10, 20, 100}, 4)
D. g.drawPolygon({3, 4, 10, 2}, {3, 10, 20, 100}, 4)

The correct answer is C


Java

Learn More Multiple Choice Question :