0
下面的对象必须调用cleanup并稍后启动。如何将调用对象返回到下一个方法以确保所有变量集仍然可用,而无需创建新的对象实例。如何在scala中返回调用对象
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()