[JAVA100 Example]002, Java Process Control

Source: Internet
Author: User

public class flowdemo{
public static void Main (string[] arges) {
int ipara1,ipara2,iend;
    if (arges.length!=3)
{
System.out.println ("Use:java flowdome parameter1 parameter2");
System.out.println ("Parameter1: Comparison condition 1, Number type");
System.out.println ("parameter2: Comparison condition 2, Number type");
System.out.println ("Circle: Cycle Times");
System.out.println ("Ego:java flowdome 1 2 5");
return;    
}else{
IPara1 = Integer.parseint (Arges[0]);
IPara2 = Integer.parseint (arges[1]);
Iend = Integer.parseint (arges[2]);
}
//if statement
if (ipara2>ipara1)
{
System.out.println ("If condition satisfied!") ");
System.out.println ("The 2nd number is larger than the 1th number!") ");
}
Else
{
System.out.println ("If condition is not satisfied!") ");
System.out.println (the 2nd number is smaller than the 1th number!). ");   
}
//for loop operation
for (int i=0;i<iend;i++)
{
System.out.println ("This is for subclause" +i+ "secondary Loop");
}
//while Loop operation
int i=0;    
while (i<iend)
{
System.out.println ("This is a while" +i+ "secondary Loop");
i++;   
}
//do-while loop operation
Int j=0;
    Do
{
System.out.println ("This is Do-while" +j+ "secondary Loop");
j + +;
}while (j<iend);
}
}

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.