By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,644 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,644 IT Pros & Developers. It's quick & easy.

An if question: are if statements loops?

P: 2
Hi,
I'm learning how to program in java its my first ever language.

I have been looking around for a Definite answer to the if statements. Are the if statements loops?
Thank you in advance.
Feb 8 '13 #1

✓ answered by Stewart Ross

If statements are not loops. They are selection statements. Loops repeat one or more actions; selection statements choose between alternative actions depending on the result of evaluating one or more conditions.

In classic terms, programming involves

* sequences - statements executed one after the other
* selections, and
* repetitions - statement sequences executed repeatedly while or until a condition is satisfied.

-Stewart

Share this Question
Share on Google+
2 Replies


Expert Mod 2.5K+
P: 2,545
If statements are not loops. They are selection statements. Loops repeat one or more actions; selection statements choose between alternative actions depending on the result of evaluating one or more conditions.

In classic terms, programming involves

* sequences - statements executed one after the other
* selections, and
* repetitions - statement sequences executed repeatedly while or until a condition is satisfied.

-Stewart
Feb 8 '13 #2

P: 2
Wow, Thank you Stewart Ross!
Great explanation.
Feb 13 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.