title: How to define a polymorphic reference variable in scala
body: <p>I have just started to explore Scala. suppose I have the following code:</p>
  
  <pre><code>abstract class Shape
  case class Square() extends Shape
  case class Circle() extends Shape
  case class Triangle() extends Shape
  </code></pre>
  
  <p>Having that, I can define a reference referring to Shape in java, and then I can store objects of Shape subclasses in it as bellow:</p>
  
  <pre><code>Shape s=null;
  s=new Circle(); 
  s=new Square();
  s=new Triangle();
  </code></pre>
  
  <p><strong>my Question:</strong>
  what is the above code counterpart in scala (note that I do want to define only one variable, namely s here)</p>