Denis Kalinin

Modern Web Development with Kotlin

Notify me when the book’s added
To read this book, upload an EPUB or FB2 file to Bookmate. How do I upload a book?
  • Vikarti Anatrahas quoted6 years ago
    For example, the if statement in Java allows to make the control flow depend on a certain condition:
    1 List<Integer> ints = null; 2 if (checkCondition()) { 3 ints = generateList(); 4 } else { 5 ints = Collections.emptyList(); 6 }
    Since if statements don’t return any values, we have to define a variable and put the assignments in both branches. In Kotlin, if is an expression, so ints can be defined as a constant and initialized immediately:
fb2epub
Drag & drop your files (not more than 5 at once)