In this video, I saw that the programmer used a return statement of this form in a static method:
public static int staticFunc(int x, int y) {
return x = y;
}
(This is not the exact function, which can be found at 10:11 in the video)
Why is this (assigning a variable in a return statement) used instead of simply returning x? And what is the name of this type of statement?
additional context: the video is about making games in java, and the method in the video is specified in the game object to allow a player object to only move in the bounds of the window. This function is used to update a property in the player object.