---- 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