# 初始抽象 val 成員

``abstract class Circle(r: Double) {    val radius = r    val area = Math.Pi * radius * radius}def calRadius = 10.0class RedCircle(r: Double) extends Circle(r)val c = new RedCircle(calRadius)println(c.area)     // 314.1592653589793``

``abstract class Circle(r: Double) {    val radius = r    val area = Math.Pi * radius * radius}def calRadius = 10.0val c = new Circle(calRadius) {            // 其它實作        }println(c.area)     // 314.1592653589793``

``trait Circle {    val radius: Double    val area = Math.Pi * radius * radius}def calRadius = 10.0class RedCircle(r: Double) extends Circle {    val radius = r}val c = new RedCircle(calRadius)println(c.area)    // 314.1592653589793``

``trait Circle {    val radius: Double    val area = Math.Pi * radius * radius}def calRadius = 10.0val c = new Circle {            val radius = calRadius        }println(c.area)，     // 0.0``

``trait Circle {    val radius: Double    val area = Math.Pi * radius * radius}def calRadius = 10.0val c = new { val radius = calRadius } with Circle {            // 其它定義        }println(c.area)    // 314.1592653589793``

``trait Circle {    val radius: Double    println(radius)    val area = Math.Pi * radius * radius}def calRadius = 10.0class RedCircle(r: Double) extends {    val radius = r} with Circle {    // 其它實作}val c = new RedCircle(calRadius)println(c.area)    // 314.1592653589793``

``trait Circle {    val radius: Double    lazy val area = Math.Pi * radius * radius}def calRadius = 10.0val c = new Circle {            val radius = calRadius        }println(c.area)     // 314.1592653589793``