Driver method to check above comparison function
public static void main ( String [ ] args ) { String version1 = "1.0.3" ; String version2 = "1.0.7" ; if ( versionCompare ( version1 , version2 ) < 0 ) System . out . println ( version1 + " ▁ is ▁ smaller " ) ; else if ( versionCompare ( version1 , version2 ) > 0 ) System . out . println ( version2 + " ▁ is ▁ smaller " ) ; else System . out . println ( " Both ▁ version ▁ are ▁ equal " ) ; } }