Java?е???????????
???????????? ???????[ 2014/12/29 11:39:26 ] ????????Java ??????? ?????
???????Java????????????????????У???????????????裬??Java????????????????????????????????????????????????д?????????????????????????÷??????????????????????????д??????????????????????Java?????????????????????????????????ú????????????????????????????
??????Java?д????????????????????????????????????????????????????????????
??????????
??????????????????????????????????????
???????private??static??final???ε???????????????t?????????鷽???????????????д?????????????????????????ж??????
????????????????????????????????????????????????ɡ?
????????(Overload)???????t????????????д(Override)????????????????ɡ?
????????????????
???????????????????????????
public class TestMain {
public static void main(String[] args) {
String str = new String();
Caller caller = new Caller();
caller.call(str);
}
static class Caller {
public void call(Object obj) {
System.out.println("an Object instance in Caller");
}
public void call(String str) {
System.out.println("a String instance in in Caller");
}
}
}
??????е????
????22:19 $ java TestMain
????a String instance in in Caller
???????????????У?call?????????????????????????????Object?????????????????????????????String?????????????????str?????String???????н???String?????????call?????????á???????????????????????????????е???????
???????
????????????????????????????????javap?????????????????
22:19 $ javap -c TestMain
Compiled from "TestMain.java"
public class TestMain {
public TestMain();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: new #2 // class java/lang/String
3: dup
4: invokespecial #3 // Method java/lang/String."<init>":()V
7: astore_1
8: new #4 // class TestMain$Caller
11: dup
12: invokespecial #5 // Method TestMain$Caller."<init>":()V
15: astore_2
16: aload_2
17: aload_1
18: invokevirtual #6 // Method TestMain$Caller.call:(Ljava/lang/String;)V
21: return
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11