public class TestOverload { public void go(Short n){ System.out.println("Short"); } public void go(int n){ System.out.println("int"); } public static void main(String[] args) { TestOverload t = new TestOverload(); short x = 6; t.go(x); } } ΪʲôÊä³öµÄÊÇint jdk5.0²»ÊÇ¿ÉÒÔ×Ô¶¯×°ÏäÂð Ϊʲô²»Ñ¡Ôñ×°Ïä¶øÊÇÑ¡ÔñÓÉshortµ½intµÄÀàÐÍ×Ô¶¯ÌáÉýJava code:
public class TestOverload { public void go(short n){ System.out.println("Short"); } public void go(int n){ System.out.println("int"); } public static void main(String[] args) { TestOverload t = new TestOverload(); short x = 6; t.go(x); } }
²»ÖªµÀÊÇʲôÔÒò£¬ÎÒ¸ÃÈçºÎ´¦Àí£¬Çë´óϺÃÇÖ¸½ÌÁË£¬Ð¡µÜÔÚ´Ëл¹ý¡£¡£¡£¡£ ´íÎóÐÅÏ¢ÈçÏ£º The program being debugged was signaled while in a function called from GDB. GDB has restored the context t ......