答案: 不能。
经过查看许多人给出的分析,得出我个人认为比较有说服力的原因:
为了克服局部内部类和局部变量的生命周期不一致问题,java只能拷贝局部变量的副本到局部内部类,如下代码
static class A {
String name;
public A(String name) {
this.name = name;
}
@Override
protected void finalize() throws Throwable {
try {
// TODO. release native resources here.
Log.i("jc", "Is calling finalize");
}finally {
super