Java方法的重载

    xiaoxiao2021-04-15  29

    重载方法调用重载方法: 1.参数少的调用参数多的 2.简单的调用复杂的

    public class Test { public int max(int a,int b){ return max( a, b,Integer.MIN_VALUE); } public int max(int a,int b, int c){ return (a>b?a:b)>c?(a>b?a:b):c; } }
    转载请注明原文地址: https://ju.6miu.com/read-671751.html

    最新回复(0)