Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Java Programming for Beginners

You're reading from   Java Programming for Beginners Learn the fundamentals of programming with Java

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781788296298
Length 318 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
SkillSprints Inc., Mark Lassoff SkillSprints Inc., Mark Lassoff
Author Profile Icon SkillSprints Inc., Mark Lassoff
SkillSprints Inc., Mark Lassoff
Arrow right icon
View More author details
Toc

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 what we're about to do, but you may have a basic understanding of what's going on and you can certainly repeat the process on your own in future.

While writing to this InputStream/Console window is kind...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime