Point(x:1 , y:2) => wrong
defined wrong parameter for Point constructor
class Point {
public Integer x;
public Integer y;
Point(Integer x, Integer y){
this.x = x;
this.y = y;
}
}
class App {
public static void main(String[] args) {
Point point = new Point(1,2);
Point point1 = point;
System.out.println("x = "+point1.x+" | y = "+point1.y);
}
}
This error happens all the time because Mosh’s editor displays the parameter names. You do not type the literal “x:” or “y:” so this should be: new Point (1, 1);
His editor adds the names for clarity, but Mosh is not literally typing that out.