I'm a student in java and have a question on how to create an object with attributes in an array. so this is my empty constructor and constructor with variables to set the attributes
public class Punt {
private int x;
private int y;
public void Punt(){
}
public void Punt(int x, int y){
this.x = x;
this.y = y;
}
}
Then i need to make an array of creating objects with x,y and i got this
public class Punten {
private int[] punten = {new Punt(3, 4),
new Punt(5, 12),
new Punt(7, 24),
new Punt(9, 40),
new Punt(11, 60),
new Punt(13, 84)
};
The error is Punt() in Punt cannot be applied to ( int, int) The red line is under the two ints
Thanks in advance for your time