java - The constructor Polygon(int[], int[], int) is undefined -
i trying figure out why program telling me constructor undefined polygon.
this exception get:
exception in thread "main" java.lang.error: unresolved compilation problem: constructor polygon(int[], int[], int) undefined @ test.main(test.java:9)
class
import java.awt.*; import java.applet.*; import java.util.*; import java.awt.geom.*; public class polygon extends applet { private int[] xpoints = { 0,-10, -7, 7, 10 }; private int[] ypoints = {-10, -2, 10, 10, -2 }; private polygon poly; public void init(){ poly = new polygon(xpoints, ypoints, xpoints.length); } }
it says polygon class must have constructor suitable
new polygon(xpoints, ypoints, xpoints.length);
see http://docs.oracle.com/javase/tutorial/java/javaoo/constructors.html
Comments
Post a Comment