package jvm;
public class Language {
public int count = 1;
public String getContent() {
return “hello world”;
}
public String getContent2() {
return “hello world 2”;
}
}
public class Person {
private final String name = “person”;
private final Language mLanguage = new Language();
public void say() {
System.out.println("Person say " + mLanguage.getContent());
}
public static void main(String[] args) {
Person person = new Person();
person.say();
}
}
javap -v Person 输出
public class jvm.Person
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Methodref #18.#33 // java/lang/Object.“”😦)V
#2 = String #34 // person
#3 = Fieldref #15.#35 // jvm/Person.name:Ljava/lang/String;
#4 = Class #36 // jvm/Language
#5 = Methodref #4.#33 // jvm/Language.“”😦)V
#6 = Fieldref #15.#37 // jvm/Person.mLanguage:Ljvm/Language;
#7 = Fieldref #38.#39 // java/lang/System.out:Ljava/io/PrintStream;
#8 = Class #40 // java/lang/StringBuilder
#9 = Methodref #8.#33 // java/lang/StringBuilder.“”😦)V
#10 = String #41 // Person say
#11 = Methodref #8.#42 // java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
#12 = Methodref #4.#43 // jvm/Language.getContent:()Ljava/lang/String;
#13 = Methodref #8.#44 // java/lang/StringBuilder.toString:()Ljava/lang/String;
#14 = Methodref #45.#46 // java/io/PrintStream.println:(Ljava/lang/String;)V
#15 = Class #47 // jvm/Person
#16 = Methodref #15.#33 // jvm/Person.“”😦)V
#17 = Methodref #15.#48 // jvm/Person.say:()V
#18 = Class #49 // java/lang/Object
#19 = Utf8 name
#20 = Utf8 Ljava/lang/String;
#21 = Utf8 ConstantValue
#22 = Utf8 mLanguage
#23 = Utf8 Ljvm/Language;
#24 = Utf8
#25 = Utf8 ()V
#26 = Utf8 Code
#27 = Utf8 LineNumberTable
#28 = Utf8 say
#29 = Utf8 main
#30 = Utf8 ([Ljava/lang/String;)V
#31 = Utf8 SourceFile
#32 = Utf8 Person.java
#33 = NameAndType #24:#25 // “”😦)V
#34 = Utf8 person
#35 = NameAndType #19:#20 // name:Ljava/lang/String;
#36 = Utf8 jvm/Language
#37 = NameAndType #22:#23 // mLanguage:Ljvm/Language;
#38 = Class #50 // java/lang/System
#39 = NameAndType #51:#52 // out:Ljava/io/PrintStream;
#40 = Utf8 java/lang/StringBuilder
#41 = Utf8 Person say
#42 = NameAndType #53:#54 // append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
#43 = NameAndType #55:#56 // getContent:()Ljava/lang/String;
#44 = NameAndType #57:#56 // toString:()Ljava/lang/String;
#45 = Class #58 // java/io/PrintStream
#46 = NameAndType #59:#60 // println:(Ljava/lang/String;)V
#47 = Utf8 jvm/Person
#48 = NameAndType #28:#25 // say:()V
#49 = Utf8 java/lang/Object
#50 = Utf8 java/lang/System
#51 = Utf8 out
#52 = Utf8 Ljava/io/PrintStream;
#53 = Utf8 append
#54 = Utf8 (Ljava/lang/String;)Ljava/lang/StringBuilder;
#55 = Utf8 getContent
#56 = Utf8 ()Ljava/lang/String;
#57 = Utf8 toString
#58 = Utf8 java/io/PrintStream
#59 = Utf8 println
#60 = Utf8 (Ljava/lang/String;)V
{
private final java.lang.String name;
descriptor: Ljava/lang/String;
flags: ACC_PRIVATE, ACC_FINAL
ConstantValue: String person
private final jvm.Language mLanguage;
descriptor: Ljvm/Language;
flags: ACC_PRIVATE, ACC_FINAL
public jvm.Person();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
0: aload_0
1: invokespecial #1 // Method java/lang/Object.“”😦)V
4: aload_0
5: ldc #2 // String person
7: putfield #3 // Field name:Ljava/lang/String;
10: aload_0
11: new #4 // class jvm/Language
14: dup
15: invokespecial #5 // Method jvm/Language.“”😦)V
18: putfield #6 // Field mLanguage:Ljvm/Language;
21: return
LineNumberTable:
line 3: 0
line 5: 4
line 6: 10
public void say();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
// 拿到一个静态对象
0: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream;
// new三兄弟又出现了
3: new #8 // class java/lang/StringBuilder
6: dup
7: invokespecial #9 // Method java/lang/StringBuilder.“”😦)V
// push常量池中的常量#10(‘Person Say’)到栈顶
10: ldc #10 // String Person say
// 调用方法StringBuilder.append()
12: invokevirtual #11 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
// push本地变量表的第0个即this到栈顶,为了调用getfield
15: aload_0
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)
小结
有了这么多优秀的开发工具,可以做出更高质量的Android应用。
当然了,“打铁还需自身硬”,想要写出优秀的代码,最重要的一点还是自身的技术水平,不然用再好的工具也不能发挥出它的全部实力。
在这里我也分享一份大佬自己收录整理的Android学习PDF+架构视频+面试文档+源码笔记,还有高级架构技术进阶脑图、Android开发面试专题资料,高级进阶架构资料这些都是我闲暇还会反复翻阅的精品资料。在脑图中,每个知识点专题都配有相对应的实战项目,可以有效的帮助大家掌握知识点。
总之也是在这里帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习,也可以分享给身边好友一起学习
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
点。
总之也是在这里帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习,也可以分享给身边好友一起学习
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!