Java中一些数据类型转化比较初始化问题

在 Java 中要将 String 类型转化为 int 类型时,需要使用 Integer 类中的 parseInt() 方法或者 valueOf() 方法进行转换.

string类型比较。equals()
int类型比较 == 、!=

System.currentTimeMillis();//获取系统当前时间 单位毫秒

java 保留字符串数字的位数,不够前面补0
private String autoGenericCode(String code, int num) {
String result = “”;
// 保留num的位数
  // 0 代表前面补充0
// num 代表长度为4
// d 代表参数为正数型
result = String.format("%0" + num + “d”, Integer.parseInt(code));

    return result;
}
上一篇:Java枚举类在生产环境中的使用方式


下一篇:Spring Security oauth2.0微信小程序登录