Java Process Control

Source: Internet
Author: User

---- Judgment Structure


If

1.
if (conditional expression)
{
Execute the statement;
}

2.
if (conditional expression)
{
Execute the statement;
}
Else
{
Execute the statement;
}

3.
if (conditional expression)
{
Execute the statement;
}
else if (conditional expression)
{
Execute the statement;
}
......
Else
{
Execute the statement;
}



---- Selection Structure


Switch

switch (expression)
{
Case takes value 1:
Execute the statement;
Break
Case takes value 2:
Execute the statement;
Break
......
Default
Execute the statement;
Break
}



---- Cycle Structure


While

while (conditional expression)
{
Execute the statement;
}


Do While

Do
{
Execute the statement;
}while (conditional expression);


For

for (initialization expression; cyclic conditional expression; post-loop action expression)
{
Execute the statement;
}

1.5 new features of the Ps:for loop:

Used to iterate over an algebraic group or collection, in the following format

for (TYPE Arg:args)

{

............

}


This article is from the "Maybe You" blog, please be sure to keep this source http://wjyzxc.blog.51cto.com/5725897/1636593

Java Process Control

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.