diff --git a/README.md b/README.md index db57b45..abe3600 100644 --- a/README.md +++ b/README.md @@ -931,6 +931,33 @@ public class User { --- +## Accessing Class members +> Java + +```java +Student student = new Student(); +student.setName("Smith"); +student.setCourse("Geology"); +student.setYear(2015); +student.setCode(200); +student.register(); + +``` + +> Kotlin + +```kotlin +Student().apply { + name = "Smith" + course = "Geology" + year = 2015 + code = 200 + register() +} +``` + +--- + ### Important things to know in Kotlin - [Mastering Kotlin Coroutines](https://amitshekhar.me/blog/kotlin-coroutines) - Mastering Kotlin Coroutines