-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b606457
commit 2a47c2d
Showing
1 changed file
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
class Lamp { | ||
class Lamp { | ||
|
||
// property (data member) | ||
private var isOn: Boolean = false | ||
// property (data member) | ||
private var isOn: Boolean = false | ||
|
||
// member function | ||
fun turnOn() { | ||
isOn = true | ||
} | ||
// member function | ||
fun turnOn() { | ||
isOn = true | ||
} | ||
|
||
// member function | ||
fun turnOff() { | ||
isOn = false | ||
} | ||
} | ||
} | ||
|
||
fun main(args: Array<String>) { | ||
|
||
val l1 = Lamp() // create l1 object of Lamp class | ||
val l2 = Lamp() // create l2 object of Lamp class | ||
} | ||
} |