Guest User

Untitled

a guest
Jun 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. fun startHere() {
  2. doSomething("Akexorcist", { name ->
  3. if (!name.contains("Ake")) {
  4. return // Error : return is not allowed herer
  5. }
  6. ...
  7. })
  8. }
  9. inline fun doSomething(name: String,
  10. crossinline block: (name: String) -> Unit) {
  11. System.out.println("Do something")
  12. block(name)
  13. System.out.println("Hello, $name")
  14. }
Add Comment
Please, Sign In to add comment