If statements - Java Basics

Important Suggestions

Using if statements in Java can become rather tough to logically work out, so I advise you separate brackets and decelerations with spaces and comments for the sake of being able to easily maintain your code.

Lesson

Common in almost every programming language are the handy if statements. If statements are used to test if a condition is correct. For example my age is 17, I would like to test if that is true or false.

If statements can be accompanied by else clauses that are executed if the particular test is evaluated to false.

Error

You need to log into your account to post comments!Sign In