Simple screenshot that explains the non-static invocation.
2014-03-08 21:21
501 查看
Here is the code:
The figure below corresponds to the above code:
/* Instance invocation in the memory: */ package kju.obj; import static kju.print.Printer.*; public class NonStaticInvoke { public static void main(String[] args) { Person p = new Person("lily"); p.setName("lucy"); } } class Person { public static final String country = "cn"; private String name; public Person(String name) { this.name = name; } public static void showCountry() { println("country = " + country); } public void setName(String name) { this.name = name; } }
The figure below corresponds to the above code:
相关文章推荐
- HDU 4308 Saving Princess claire_(简单BFS)
- STL源码分析《4》----Traits技术
- STL源码分析《4》----Traits技术
- Attribute Set Will Not Save Hangs on “Please Wait”
- Unzip 6.0 fails to compile under 64-bit systems with the instructions in the book
- 算法杂货铺——分类算法之朴素贝叶斯分类(Naive Bayesian classification)
- rtlinitializeexceptionchain
- extmail 推荐
- LAMP+extmail+postfix+dovecot
- rails登录跳转
- 移植EMCV到DM6467(3)——CCS调试XDAIS算法
- tnsnames.ora中的一个连接串不能从LISTENER连接时通过另一个监听连接(failover)
- container_of宏_共享内存
- sigsuspend函数和sigwait函数
- extmail
- sleep() 和wait() 有什么区别?
- UVA 11029 - Leading and Trailing
- linux的waitpid 和wait 以及fg 和bg命令
- AIDL Service
- "spark is now FAILED (Command exited with code 1)" 错误解决