class Count01{ public int compare(int a,int b){ return a>b?a:b; //return Math.max(a,b); } } public class Method02 { public static void main(String[] args) { Count01 c =new Count01(); int res = c.compare(9,6); System.out.println("较大值是:"+res); } }
java求最大值
最新推荐文章于 2023-02-28 20:18:08 发布