2
我試圖通過終端如何通過終端快速打印?
shape.swift運行./swift -emit-executable shape.swift
class Shape
{
let name:String = ""
init(name:String)
{
self.name = name
}
let anyShape = Shape.init(name:"Jaum")
println("Name, \(anyShape.name).")
}
我得到這個錯誤:
shape.swift:11:5: error: expected declaration
println("Name, \(anyShape.name).")
^
我在做什麼錯?