1. 程式人生 > >java 判斷是否大於指定版本號

java 判斷是否大於指定版本號

ger class oop eat public result val split util

    public boolean is_version_great_than(String version) {
        boolean result = false;
        if (!StringUtil.isNullorEmpty(version)
            && version.indexOf(".") >= 0) {
            String[] version_num = version.split(".");
            String[] cur_num = clientVersion.split(".");
            
int loop_count = version_num.length; if (cur_num.length < version_num.length) { loop_count = cur_num.length; } for (int i = 0; i < loop_count; i++) { if (Integer.valueOf(version_num[i]) > Integer.valueOf(cur_num[i])) { result
= true; break; } } } return result; }

java 判斷是否大於指定版本號