Java tutorial
//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; } }