Bob*_*r02 4 java heap space anonymous-class
假设以下场景:
void thisIsCalledManyTimes(){
// ....
someObject.executeIfNecessary( new Runnable(){
void run(){ //do sth here}
});
}
Run Code Online (Sandbox Code Playgroud)
匿名对象占用多少空间?我知道每个对象匿名obj都会有一个指向run其方法查找表中相同实现的指针.
| 归档时间: |
|
| 查看次数: |
715 次 |
| 最近记录: |