title: How to return the calling object in scala
body: <p>The object below has to called using cleanup and later start. How to return the calling object back to the next method to make sure all the variables set are still available, without creating a new object instance.</p>
  
  <pre><code>class a =
  {
      val z ="Hello"
  
      def remove(): com.hello.a =
      {
          return ? /* how to return the same object type A , so that start() definition gets the correct object**/
      }
  
      def start () : unit = 
      {      
          /**buch of tasks **/
      }
  }
  
  a.remove().start()
  </code></pre>