O'Reilly logo

Java Programming for Beginners by Mark Lassoff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required