java 生成有序账号的实现方法
作者:jingxian 时间:2023-08-12 03:28:01
如下所示:
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
标签:java,生成,有序,账号
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java编程中随机数的生成方式总结
2022-06-14 11:57:27
java线程池详解及代码介绍
2023-09-16 07:21:57
![](https://img.aspxhome.com/file/2023/7/76517_0s.png)
浅谈Java获得多线程的返回结果方式(3种)
2023-04-02 05:37:36
Android7.0 MessageQueue详解
2021-08-29 17:01:43
![](https://img.aspxhome.com/file/2023/0/103870_0s.jpg)
C# 调用WebService的方法
2022-03-19 12:42:37
![](https://img.aspxhome.com/file/2023/2/89852_0s.png)
浅谈JAVA 内存流的实现
2021-06-28 05:43:59
![](https://img.aspxhome.com/file/2023/5/86815_0s.jpg)
mybatis主从表关联查询,返回对象带有集合属性解析
2023-06-15 16:10:59
![](https://img.aspxhome.com/file/2023/6/79236_0s.jpg)
Android下拉刷新上拉加载控件(适用于所有View)
2022-09-20 21:40:20
![](https://img.aspxhome.com/file/2023/3/117093_0s.gif)
SpringCloud @RefreshScope注解源码层面深入分析
2023-06-14 03:17:27
![](https://img.aspxhome.com/file/2023/9/108389_0s.png)
比较2个datatable内容是否相同的方法
2022-11-25 08:27:04
C#实现给图片添加日期信息的示例详解
2021-07-29 21:19:28
![](https://img.aspxhome.com/file/2023/2/84462_0s.png)
Android设计模式之Builder模式详解
2022-01-17 12:29:02
Spring session 获取当前账户登录数的实例代码
2022-10-17 10:02:05
Android EventBus 3.0.0 使用总结(必看篇)
2023-09-06 06:32:41
![](https://img.aspxhome.com/file/2023/9/129039_0s.jpg)
C#实现带阴历显示的日期代码
2023-12-11 02:19:04
Java利用钉钉机器人实现发送群消息
2021-06-28 23:37:33
![](https://img.aspxhome.com/file/2023/8/70968_0s.png)
详解spring boot使用@Retryable来进行重处理
2021-07-11 18:34:11
Android Studio实现简单音乐播放功能的示例代码
2021-09-14 19:51:45
![](https://img.aspxhome.com/file/2023/3/106053_0s.gif)
JAVA使用hutool工具实现查询树结构数据(省市区)
2021-11-04 18:30:09
![](https://img.aspxhome.com/file/2023/0/128810_0s.png)
JAVA HashMap详细介绍和示例
2023-04-07 00:17:43
![](https://img.aspxhome.com/file/2023/2/88742_0s.jpg)