我正在尝试将数组作为参数传递给另一个类,但始终收到错误 “错误:类型不兼容:点不能转换为int []”
我的代码的第一部分是:
public Circle(int n,int x,int y)
{
radius = n;
counter++;
center[0] = x;
center[1] = y;
Point center = new Point(center);
}
Point是需要将数组传递给它的类。
第二部分代码:
public class Point
{
private int xCord;
private int yCord;
public Point (int [] center)
{
xCord = center[0];
yCord = center[1];