title: adding an object to list in scala
body: <p>I am trying to add and object to a list not just a number so when you reply with an example if you could use an object like my used car example or a fruit or something
  I've been looking every where and all the examples i see are just adding numbers to a list.<br>
  Im trying to convert some java code into scala
  the java code im having trouble converting is</p>
  
  <pre><code>ArrayList usedCarList = new ArrayList();
  UsedCars usedCar = new UsedCars();
  usedCarList.add(usedCar);
  </code></pre>
  
  <p>Now i've looked at a few examples but they dont seem to work once i start trying to use an object ie</p>
  
  <pre><code>var b = List[Int](); 
  b ::= 1; 
  b ::= 2; 
  b ::= 3; 
  </code></pre>
  
  <p>I've tried a few things 1 is listed below.</p>
  
  <pre><code>var usedCarList = List();
  def addCar (usedCarList: List[UsedCars]){
  var usedCar = new UsedCars();
  series of set operations on the usedCar
  usedCar :: usedCarList;
  println(usedCarList.length);
  }
  </code></pre>
  
  <p>when i check the size of the list its always empty</p>