Skip to content

Commit 7e802df

Browse files
kotlin-samples-pusher-botdkrasnoff
authored andcommitted
test(samples): add new samples
1 parent 2fd530d commit 7e802df

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
data class Employee(val name: String, val roles: MutableList<String>)
2+
3+
fun main() {
4+
val original = Employee("Jamie", mutableListOf("developer"))
5+
val duplicate = original.copy()
6+
7+
duplicate.roles.add("team lead")
8+
9+
println(original)
10+
// Employee(name=Jamie, roles=[developer, team lead])
11+
println(duplicate)
12+
// Employee(name=Jamie, roles=[developer, team lead])
13+
}

0 commit comments

Comments
 (0)