title: Scala instance variables best practice
body: <p>How would one translate the following Java code to Scala?</p>
  
  <pre><code>class ClassA {
      private int field1;
      private int field2;
  
      public ClassA() {
          field1 = 1;
          field2 = 2;
      }
  }
  </code></pre>
  
  <p>I can see two options:</p>
  
  <pre><code>class ClassA(val field1: Int, val field2: Int) {
     ....
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>class ClassA {
     val field1: Int = 1
     val field2: Int = 2
  }
  </code></pre>
  
  <p>What is recommended, and why?</p>