title: Difference between protected and protected[this]
body: <p>I have the following code:</p>
  
  <pre><code>class Base{
      protected val alpha ="Alpha";
      protected def sayHello = "Hello";
  }
  class Derived extends Base{
          val base = new Base;
          def hello = println(this.alpha +" "+this.sayHello) ;
         // def hello = println(base.alpha +" "+base.sayHello) ; // don't compile
      }
  
      object MyObj extends App{
              val x=new Derived;
              x.hello;
          }
  </code></pre>
  
  <p>In class <code>Base</code>, if I label <code>protected</code> with <code>this</code>, the code works as expected; if I don't label it with <code>this</code>, everything works as expected too.</p>
  
  <p>Are <code>protected</code> and <code>protected[this]</code> equivalent in Scala? If yes, why would Scala provide both? If not, how do they differ?</p>