Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and contain only digits and the . character.The . characte…
package com.Summer_0424.cn; /** * @author Summer * 两个数字比较大小的方法 * 分别应用if-else和条件运算符实现 */ public class Test07 { public static void main(String[] args) { //用if-else实现 int a = 1; int b = 2; if (a>b) {//如果a比b大,输出a>b System.out.println("a>b")…