How do I throw values calculated back to buildForm()? I am trying to throw back values that are calculated in submitForm() to buildForm().

How do I add more state values into it?

    /**
     * @file
     * Contains \Drupal\resume\Form\ResumeForm.
     */
    namespace Drupal\resume\Form;

    use Drupal\Core\Form\FormBase;
    use Drupal\Core\Form\FormStateInterface;

    class ResumeForm extends FormBase {
      /**
       * {@inheritdoc}
       */
      public function getFormId() {
        return 'resume_form';
      }

      /**
       * {@inheritdoc}
       */
      public function buildForm(array $form, FormStateInterface $form_state) {
         $form['number1'] = array(
          '#type' =&gt; 'textfield',
          '#title' =&gt; t('number 1'),
          '#required' =&gt; TRUE,
        );

        $form['number2'] = array(
          '#type' =&gt; 'textfield',
          '#title' =&gt; t('number 2'),
          '#required' =&gt; TRUE,
        );

        $form['actions']['#type'] = 'actions';
        $form['actions']['submit'] = array(
          '#type' =&gt; 'submit',
          '#value' =&gt; $this-&gt;t('Save'),
          '#button_type' =&gt; 'primary',
        );

  $header = array(
    'total',
  );
  $output = array();
  foreach ($form_state-&gt;getValues() as $key =&gt; $value) {
     $output['total'] = $total;
  }
  $form['mytable'] = array(
    '#type' =&gt; 'table',
    '#header' =&gt; $header,
    '#rows' =&gt; $output,
    '#empty' =&gt; t('No Data'),
  );

        return $form;
      }


      /**
       * {@inheritdoc}
       */
      public function submitForm(array &amp;$form, FormStateInterface $form_state) {

        foreach ($form_state-&gt;getValues() as $key =&gt; $value) {
          drupal_set_message($key . ': ' . $value);
        }

$total = $form_state-&gt;getValue('number1') * $form_state-&gt;getValue('number2');

    $form_state-&gt;setValue('total',array($total));

           }
        }
You can add the following code: 

/**
 * {@inheritdoc}
 */
  public function buildForm(array $form, FormStateInterface $form_state) {
     ...
     if (!empty($form_state-&gt;get('total')) {
       $form['total'] = array(
         '#type' =&gt; 'markup',
         '#markup' =&gt; '&lt;p&gt; Total is: &lt;strong&gt;' . $form_state-&gt;get('total') . '&lt;/strong&gt;&lt;/p&gt;',
       );
     }
    //$header = array(
    //  'total',
    //);
    //$output = array();
    //foreach ($form_state-&gt;getValues() as $key =&gt; $value) {
    //   $output['total'] = $total;
    //}
    //$form['mytable'] = array(
    //  '#type' =&gt; 'table',
    //  '#header' =&gt; $header,
    //  '#rows' =&gt; $output,
    //  '#empty' =&gt; t('No Data'),
    //);
    return $form;
   }


Add the following code to your submit handler:

/**
 * {@inheritdoc}
 */
 public function submitForm(array &amp;$form, FormStateInterface $form_state) {
   ...
    $total = $form_state-&gt;getValue('number1') * $form_state-&gt;getValue('number2');
    $form_state-&gt;set('total', $total);
    $form_state-&gt;setRebuild(TRUE);
    return $form
 }