Are edited files in core modules overwritten on updating Drupal? I have searched related questions but could't really find a decisive YES or NO.

I changed a few files in core/modules/user/ ... to alter the display of the form used on my site. For example:

 $form['account']['name'] = [
      '#type' =&gt; 'textfield',
      '#title' =&gt; $this-&gt;t('Username'),
      '#maxlength' =&gt; USERNAME_MAX_LENGTH,
      '#description' =&gt; $this-&gt;t(''),
      '#required' =&gt; TRUE,
      '#attributes' =&gt; [
        'class' =&gt; ['username'],
        'placeholder' =&gt; $this-&gt;t('Username'),   // ADDED THIS
        'autocorrect' =&gt; 'off',
        'autocapitalize' =&gt; 'off',
        'spellcheck' =&gt; 'false',
      ],
      '#default_value' =&gt; (!$register ? $account-&gt;getAccountName() : ''),
      '#access' =&gt; ($register || ($user-&gt;id() == $account-&gt;id() &amp;&amp; $user-&gt;hasPermission('change own username')) || $admin),
    ];



  Do these edited core files revert back to their original state thus deleting my changes when I update Drupal in the future?
YES, for sure. Clear enough ....?

PS: that's also why one should never hack core ...