Implementation method of generating ordered account in Java _java

Source: Internet
Author: User

As shown below:

for (int i= 0; i<= 1084 i++) {

if string.valueof (i+1). Length () = 1) {
username = "sys_000" + (i+1);
}
if (string.valueof (i+1). Length () = = 2)
{username = "sys_00" + (i+1);
}
if (string.valueof (i+1). Length () = = 3) {
username = "Sys_0" + (i+1);
}
if (string.valueof (i+1). Length () = = 4) {
username = "Sys_" + (i+1);
}
SYSTEM.OUT.PRINTLN (username);
}
sys_0001
sys_0002
sys_0003
sys_0004
sys_0005
sys_0006 sys_0007 sys_0008
sys_0009
sys_0010
sys_0011
sys_0012
sys_0013
sys_0014 sys_0015 sys_ 0016
sys_0017
sys_0018
sys_0019
sys_0020
sys_0021 sys_0022 sys_0023 sys_0024
sys_0025
sys_0026
sys_0027
sys_0028
sys_0029 sys_0030 sys_0031
sys_0032
sys_0033
sys_0034
sys_0035
sys_0036

The above is a small series for everyone to bring the Java generated ordered account of the implementation of the whole content, I hope that we support cloud Habitat Community ~

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.