????????invokevirtual??????????ù????????????
????(1) invokevirtual????е?#15?????AutoCall?????????е?15???????????????????????(CONSTATN_Methodref_info) ??????????f1????????????(????f1??????????????????????????)??JVM??????????????????????????÷???f1???????????: hr.test.Father????????????÷???f1????????father?????Father?????
????(2) ??Father???????????в??????f1????????????????f1????????е???????11(?????)?????AutoCall?????????е?15??????????(????????? )??????????????????Father?????????????з???f1????????Son?????з??????У????????????????????????÷???f1????????father???????Father?????
????(3) ?????invokevirtual?????????aload_1??????????????????е?Son???????????????????????invokevirtual??????????Son???????????????????е?Son??????????????Son?????????????????????????????????

????(4) ?????????(2)???н???????#15???????е?????????????11???????λ??Son??????????е????f1()?????????????????÷??????????????????
??????????????????(father)??????????(Father)?????????????÷???f1??λ??????????father????????????????????Son?????f1?????????λ?á?????????????й????У??????????????????????????λ????????????????? ????????? ??
???????????????????????????????????????????£?JVM????ζ?λ???????????????????????÷???JVM????ζ?λ?????(??????????????е?Father??Son????)
????public class AutoCall{
????public static void main(String[] args){
????Father father=new Son();
????char c='a';
????father.f1(c); //????????father-f1()  para-int 97
????}
????}
??????????Fahter?????в???з???????f1(char)???????????????????JVM??????Father?????е?f1(int)??????????е????Son?????е?f1(char)??????
???????????????????????ù???????????????????JVM????????????father??????????Father?????????????(?????Father???????е????????????泣?????е????????)?????Father????????”????” ?????????????г???????????????????????????
???????????”????”?????????????????????????????????????????????????????е?????????????????????в????????????????????????е???father.f1(char)??Father????????f1(char)????????????????JVM????????“???”?????????? ???????????? ???? ??“????”?? ??????????char??????????????int?????Father???п??????????????? (????Java???????????????μ????????Java??????????)??????????????????????????????????“???”??????????????????????????????
class Father{
public void f1(Object o){
System.out.println("Object");
} public void f1(double[] d){
System.out.println("double[]");
} }
public class Demo{
public static void main(String[] args) {
new Father().f1(null); //??????
?? double[]
}
}
????null???????????κε?????????????JVM??????“????”????????????????????????????????????????????????????????κβ??????????????????????????????????????: ?κδ????f1(double[])???????????????????f1(Object)???????????????У????f1(double[])??????????????JVM????????????????????
???????
????(1) ??????з???????????????????????????????<clinit>??????t?????????????????????????????÷???????????е?????????JVM???е??????????????γ???????????ɡ?
????(2) ????????????????????й????в????????????
?????????????????????????(?????????????)???“????”??????????崠?????£?
?????? ?????????????????????????????????(???????????)????????????????????????
?????? ???????????????????£???????“???”????????????????????????????????????????????????????????????????????f(A)??f(B)?????????????????????????????????f(A)???????????????????f(B)????f(A)????????f(B)???? ??
?????? ???????????????????????“????”??????????????????????
???????????????д??????????????????????????????????????????????????е?λ?á?
??????д??override??
???????????????????д??override?????????п??????????????????????????????????????????????dynamic dispatch???????仰???VM?????????????????????????????????д????????д?????????????????????????????б?????????????????????
????class Base{
????public void f(){}
????}
????class Derived extends Base{
????public void f(){}
????}
?????????hide??
??????????????????????????????????hide?????????п????????????????????????????????????????)???????????????????????????????????????????С?
????class Base{
????public static void f(){}
????}
????class Derived extends Base  {
????private static void f(){}   //hides Base. f()
????}
?????????overload??
????????????е?????????????overload???????????????????????????????????????????????????????????????????????????
????class CircuitBreaker{
????public void f (int i){}    //int overloading
????public void f(String s){}   //String overloading
????}
??????Σ?shadow??
??????????????????????????????Σ?shadow????????????????Χ?????????????????б????????????????????????屻??????????????????????????????????;????????????????????????????????
????class WhoKnows{
????static String sentence=”I don't know.”;
????public static void main(String[] args??{
????String sentence=”I don't know.”;  //shadows static field
????System.out. println (sentence);  // prints local variable
????}
????}
?????????????????????????????????????÷????漰??Ρ???????????????????????????????????????????????????????????????????????÷?????????з????????????Java?????????????????????????????
????class Belt{
????private find int size ;  //Parameter shadows Belt. size
????public Belt (int size){
????this. size=size;
????}
????}
?????????:
?????????obscure??
?????????????????????????????????????????????????????Χ??:????????????????????????????????Χ??????????????????????????????????????????????????????????????????????????λ????????????????????????????Щ?????????:???????????????????????????????????????????????????????????????????????????????????????????????У?????????????????????г???????????????????????????????????????????????:
????public class Obscure{
????static String System;// Obscures type java.lang.System
????public static void main(String[] args)
????// Next line won't compile:System refers to static field
????System. out. println(“hello?? obscure world!”);
????}
????}