Understanding if statements

Today, we're going to explore the very basic if and else conditional statements. To understand this further, refer to the following bullet list:

  1. Let's create a new Java project in NetBeans. I'm going to call mine ConditionalStatements, and I will allow NetBeans to create the main class for me; refer to the following screenshot:

To keep things clean, we can get rid of all our comments; now we're good to go. To allow us to write more interesting programs, we're going to quickly learn how to do some basic user input in Java. At this point in time, you don't have the knowledge base to fully grasp the intricacies of ...

Get Java Programming for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.