}
/**
* 继承两个trait,N多方便啊!
*/
class TestClass000 extends Trait000 with Trait001{
}
/**
* 继承两个abstract class,Error了。Error信息如下:
* Multiple markers at this line
- class AbstractClass001 needs to be a trait to be
mixed in
- class AbstractClass001 needs to be a trait to be
mixed in
*/
class TestClass001 extends AbstractClass000 with AbstractClass001{
}
/**
* 构造带参数的构造函数,trait,你可以吗?报错信息如下:
* traits or objects may not have parameters
* 但是abstract class是Ok的
*/
trait Trait003(i : Int){
}
/**
* 构造带参数的构造函数,abstract class 是Ok的
*/
abstract class AbstractClass003(i : Int){