title: Setting a variable in a return statement
body: <p>In this <a href="https://www.youtube.com/watch?v=5ufOPX8N1Rg" rel="nofollow noreferrer">video</a>, I saw that the programmer used a return statement of this form in a static method:</p>
  
  <pre><code>public static int staticFunc(int x, int y) {
      return x = y;
  }
  </code></pre>
  
  <p><em>(This is not the exact function, which can be found at <a href="https://youtu.be/5ufOPX8N1Rg?t=10m11s" rel="nofollow noreferrer">10:11</a> in the video)</em></p>
  
  <p>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?</p>
  
  <p><em>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.</em></p>