Java??д????????????????
???????????? ???????[ 2015/11/27 11:18:30 ] ???????????????
????????
???????????????? ???????????SuperClass
????public class SuperClass {
????private int mSuperX;
????public SuperClass() {
????setX(99);
????}
????public void setX(int x) {
????mSuperX = x;
????}
????}
????????????????????mSuperX??????? ???÷??? ???????????????mSuperX????? ???????setX????? ??????????????SuperClass?? ??дsetX?????? ???????????.???????????????SubClass:
????public class SubClass extends SuperClass {
????private int mSubX = 1;
????public SubClass() {}
????@Override
????public void setX(int x) {
????super.setX(x);
????mSubX = x;
????System.out.println("SubX is assigned " + x);
????}
????public void printX() {
????System.out.println("SubX = " + mSubX);
????}
????}
?????????mSubX??????mSuperX
?????????ViewGroup?У? clipToPadding??????true(???????? ????????boolean?? ????????)?? ??ViewGroup??????п????????setClipToPadding?? ??????????? ??????????????? ??mSubX??????1.
????????main?????:
????public class Main {
????public static void main(String[] args) {
????SubClass sc = new SubClass();
????sc.printX();
????}
????}
?????????? ??????? ??????????????????:
????SubX is assigned 99
????SubX = 99
??????????????к????????:
????SubX is assigned 99
????SubX = 1
??????????
???????????????????? ????????????????????????????е?? ???絥??????? ?????????? ????Java?????.
??????????Main???????
????Compiled from "Main.java"
????public class bugme.Main {
????......
????public static void main(java.lang.String[]);
????Code:
????0: new #2 // class bugme/SubClass
????3: dup
????4: invokespecial #3 // Method bugme/SubClass."<init>":()V
????......
????}
?????????????javap??????.class????????. ????????Javaд??? ??apktool??????APK???(???е?dex???)?????smali??????Java Bytecode??????ò????.
?????????????????? ???????????????????????????????.
??????δ???????new???SubClass????? ??????????? dup?????????????????? invokespecial #3????????????????????????????? ???????????????????????????3??????????? ????javap??????????????????д???????? ??SubClass.<init>.
????????????SubClass.<init>??
????public class bugme.SubClass extends bugme.SuperClass {
????public bugme.SubClass();
????Code:
????0: aload_0
????1: invokespecial #1 // Method bugme/SuperClass."<init>":()V
????......
?????????沢??з?????<init>?? ?????javap??????????????? ?????????????bugme.SubClass?? ?????? bugme?????. <init>????????????????????????? ????Java?????????????????? ?????????????????????????????????????? ?????????????????? ???????????У? ??Щ??????????????????????????????????????. ????aload_0??????????????±??0?????????? ?????Java?е?this?? ???invokespecial #1?? ?????????????????? ????????????super().
???????????????SuperClass.<init>
????public class bugme.SuperClass {
????public bugme.SuperClass();
????Code:
????0: aload_0
????1: invokespecial #1 // Method java/lang/Object."<init>":()V
????4: aload_0
????5: bipush 99
????7: invokevirtual #2 // Method setX:(I)V
????10: 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