the following code:
public class Drone {
static int x;
static int y;
public Drone(int x, int y) {
toString(x, y);
System.out.println("X is "+x);
System.out.println("Y is "+y);
}
public String toString(int x, int y) {
System.out.println("X is "+x);
System.out.println("Y is "+y);
return "Drone 0 is at "+x+","+y;
}
public static void main(String[] args) {
Drone d = new Drone(5, 3); // create drone
System.out.println(d.toString()); // print where is
}
Makes the line System.out.println(d.toString());
seem to not print. As seen here: