-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2019-12-19:谈一谈Java成员变量,局部变量和静态变量的创建和回收时机? #215
Comments
个人简单理解(java基础的东西):
3.静态变量:比较常用,大家都可以直接调用(类名直接 . ***就可以了 ) ,随着类创建而创建,类消失它也消失 欢迎指正一下,有事容易记混 |
我理解的和楼上差不多,但是有的地方还不是太一样。当然这也是我自己的理解,欢迎指正。
|
成员变量:生命周期伴随类对象,类对象回收时回收 存在堆里 |
这个可以通过饿汉式的单例模拟为撒没有并发问题去理解 |
局部变量:方法调用时创建 方法结束时被标记为可回收 存在栈里 |
No description provided.
The text was updated successfully, but these errors were encountered: