public class Test{void max(int a, int b){System.out.println( a>b?a:b);}void max(short a,short b){System.out.println( a>b?a:b);}public static void main(String[] args){Test t = new Test();t.max(3,4);}}上面这个肯定是重载,问题在于何时执行max(short a,short b).由于jvm在默认情况下都会把整数转化为int类型。因此只会执行max(int a,int b).下面可以执行到:
转载
2011-11-25 19:31:00
83阅读
2评论
1.建立MBean package com.lht.jmx; /* HelloMBean.jase there are two oper
翻译
2023-05-17 14:08:12
153阅读