My problem: I want to create objects in a method that receives the object I want to create and how many I want. Also each one receives different arguments in the constructor
public void addTiles(int x, int y, int rows, int columns, Object tile){
for(int i=0; i<rows; i++){
for(int j=0; j<columns; j++){
//Attempts
//add(new Class<tile.getClass()>(x+j*64,y+i*64));
//add(tile.getClass().newInstance().setLocation(x+j*64,y+i*64));
//add(((GameTile)tile.clone()).setLocation(x+j*64,y+i*64));
}
}
}