从main调用ArrayList <point>并将Integer数组作为参数提供

时间:2018-04-26 21:54:35

标签: java arraylist casting integer

我在java中有这个方法,我想从main调用findskyline。我想作为参数给出1D数组,输入Integer。我怎么能这样做?

public static ArrayList<Point> findSkyline(Building[] buildings)
{
    int n = buildings.length;
    ArrayList<Point>finalskyline=new ArrayList<Point>();
    .....
    .....
    return finalskyline;
}

public static class Building{
    int left, right, height;

    public Building(int left, int right, int height) {
        this.left = left;
        this.right = right;
        this.height = height;
    }
}

public static class Point{
    public int x, y;
    public Point(int x, int y){
        this.x = x;
        this.y = y;
    }
}

1 个答案:

答案 0 :(得分:0)

S1[0].style.display = (S1.style.display === 'block' ? 'none' : 'block');

我基本上读取了一个包含坐标的文件,并在matrix_y中以x坐标和另一个y存储在数组matrix_x中。从那里和所有我想传递方法findSkyline

的表