About the Puzzles
I’ll begin each story by showing you the code for a short Kotlin program—no more than a few lines and no additional dependencies. Your job is to read the program and figure out what it’s going to do. Does the program compile and run? If so, what does it output?
I’m not out to trip you up with syntax errors or spelling mistakes. If a puzzle fails to compile, the issue will be something subtle or surprising that invites you to think more deeply about the code. More often than not, the program will run just fine, but it won’t do what you were expecting.
After you’ve studied the code, turn the page to discover the correct output and learn more about the program’s behavior. Visit the book’s dedicated page[1] on the Pragmatic Bookshelf ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access