Duration: 16 min.
Summary: In this video we start our discussion on control flow, exceptions and assertions. We will cover the questions related to these concepts in the next 4 videos. To start with, the only legal expression in an if statement is a boolean expression. When we have multiple if/else statements, we can replace them with a switch statement. The switch statement can evaluate only to enums, byte, short, int, and char data types. In a switch statement, we use the break statement to get out of a case. If we do not, we fall into the next case. In this video, I give a quick overview of switch, loops, break, continue, Exceptions, and assertions. Then I cover couple of questions related to compiling assertions with a version 1.3 and 1.4 of the java language to see how the compiler will react to that. Then we tackled a question about throwing an exception and how that bubbles up to the calling methods.