Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Basics!
You have completed Java Basics!
Preview
In this video, we will learn how to check multiple conditions in one statement using a logical OR statement.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
One useful tool we have
is the logical OR expression.
0:00
This lets us check multiple conditions
in a single if statement.
0:02
For example,
we can say if the noun is dork
0:06
or if the noun is jerk,
then exit the program.
0:09
You can chain as many OR statements
as you want.
0:14
Let's add this logical
or to exit our program if the user enters
0:16
dork or jerk.
0:20
So blocking
jerk as a noun is going to be very easy.
0:23
In fact, the only thing I think I need
to show you is the syntax for or in Java.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up