Classes

Run Settings
LanguageSwift
Language Version
Run Command
func main() { let persian = Kucing() persian.color = "Putih" persian.height = 24.0 persian.length = 46.0 persian.weight = 2.0 let bengal = Kucing("Coklat", 22.0, 39.0, 2.3) let anggora = Kucing("Abu-abu", 25.0, 41.0, 2.4) } main()
class Kucing { private var _color: String private var _height: Double private var _length: Double private var _weight: Double init(_ color: String, _ height: Double, _ length: Double, _ weight: Double) { _color = color _height = height _length = length _weight = weight } init() { _color = "" _height = 0 _length = 0 _weight = 0 } var color: String { set(value) { _color = value } get { return _color } } var height: Double { set(value) { _height = value } get { return _height } } var length: Double { set(value) { _length = value } get { return _length } } var weight: Double { set(value) { _weight = value } get { return _weight } } }
Editor Settings
Theme
Key bindings
Full width
Lines