Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static int verEquals(String ver1, String ver2) {
        String[] ver1s = ver1.split("\\.");
        String[] ver2s = ver2.split("\\.");
        for (int i = 0; i < ver1s.length; ++i) {
            if (Integer.valueOf(ver1s[i]) > Integer.valueOf(ver2s[i])) {
                return 1;
            } else if (Integer.valueOf(ver1s[i]) < Integer.valueOf(ver2s[i])) {
                return -1;
            }
        }
        return 0;
    }
}