title: Using class parameters to assign field value
body: <p>I'm new to scala and would like to use class parameters to assign the value to a field of the same. In Java, we do similar thing within a constructor:</p>
  
  <pre><code>public class Test{
  
      private final int value;
  
      public Test(int value){
          this.value = value;
      }
  }
  </code></pre>
  
  <p>Now, I tried to do a similar thing in <code>Scala</code>:</p>
  
  <pre><code>class Test(value: Int){
     val value = ..WHAT..value //Is there a way to assign a parameter value to a field with the same name?
  }
  
  object Test{
     def testMethod = //access value and do something with it.
  }
  </code></pre>
  
  <p>Can we do something similar to what we can in do in Java?</p>