title: Both var and val are creating immutable Set, but var is allowing to add a new value whereas val is not
body: <p>I am from Java background and trying to learn Scala.</p>
  
  <p>There is an example as below in the book "Programming in Scala - Third Edition"</p>
  
  <pre><code>var jetSet = Set("Boeing", "Airbus")
  jetSet += "Lear"
  println(jetSet.contains("Cessna"))
  </code></pre>
  
  <p>The first line creates an immutable non-final Set:</p>
  
  <pre><code>jetSet: scala.collection.immutable.Set[String] = Set(Boeing, Airbus)
  </code></pre>
  
  <p>The second line runs with no errors.</p>
  
  <p>Now, when I change the first line from <strong>var</strong> to <strong>val</strong>, the second line gives error:</p>
  
  <pre><code>&lt;console&gt;:13: error: value += is not a member of scala.collection.immutable.Set[String]
     jetSet += "Lear"
  </code></pre>
  
  <p>I am not able to understand the reason behind it. <strong>val</strong> corresponds to final and var is non-final. I am not assigning the variable to any new Set. In both the cases, the Set is immutable.</p>
  
  <p>How is <strong>var</strong> or <strong>val</strong> impacting things here?</p>
  
  <p>Also, when jetSet is immutable in both the cases, why is it allowing to add a new value to the set in the case of <strong>var</strong>. Does it not violate the immutability principle.</p>
  
  <p>Correct my understanding, please.</p>