this = 反编译Java中的this
我尝试反编译一个没有源代码的 Java 应用程序,结果出现了奇怪的情况。 在类的构造函数的顶部,有一行内容
this = this
是 this (不是 this)意味着什么? 这只是反编译过程的产物吗? 或者这只是一些丑陋的黑客行为? 这个可以分配给其他东西吗? 如果是这样,
this = null
意味着什么?
I tried decompiling a Java application to which I do not have the source code and a strange thing showed up. At the top of the constructor for a class, there is a line that says
this = this
What does this (not this) mean? Is this just an artifact of the decompilation process? Or is it just some ugly hack? Can this be assigned to something else? If so, what does
this = null
mean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这
是最终的。 你绝对不能分配它。 我猜这是一个反汇编器工件。内部类(其中包含指向外部类的
this
指针)可能存在一些潜在的愚蠢之处,但所编写的这些行不是有效的 Java。this
is final. You definitely cannot assign it. I'd guess this is a disassembler artifact.There's some potential goofy-ness with inner classes (which hold
this
pointers to the outer class), but those lines as written are not valid Java.