From the course: Kotlin Essential Training: Functions, Collections, and I/O
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Stepping through code - Kotlin Tutorial
From the course: Kotlin Essential Training: Functions, Collections, and I/O
Stepping through code
- [Speaker] Okay, once we've stopped execution of our code at a break point, what next? How can we efficiently inspect our code and walk through the execution of our program to find the issue? Let's take a closer look at the debugger tools to understand how to step through code line by line, and how to set conditional break points that only pause execution under specific circumstances. So again, we will use this same loop function here to test out these debugging tools. And again, just as quick review, this code will iterate over a range from zero to four, generate a random number, and should ideally print out correctly whether that number is odd or even. And we also still have a single break point in this code here placed on the line where we determine whether our value is odd or even. If we now run our code with the debugger attached, we'll see that the debugger stops at that break point when calculating whether the…