Java中易混淆
来源:互联网 发布:mac 邮箱软件 编辑:程序博客网 时间:2024/05/16 05:59
1,instance variance vs. class variance , constant vs. static
local
instance var: each object of that class has that a different version of that variable. eg: count1, count2, each have their own variables, their own box
class var: a variable shared by all objects in a class eg: there's one variable counter , that all objects of the type of the class are referring to the one single box
specify:
instance var: private/ public and give a name
class variable: add "static", a static variable-----a static variable, eg: constant. PI should be shared as a class variable among all circles. We just want one it share, so we call static
constant is static
but static is not necessarily constant, they don't have to be final
eg:
/* create a class variable */
private static int COUNTER;
instance variable有很多copy
class variable只有一个copy 被share
区别在于有static
并且可以通过类名访问
constant实际上都是class vvativariable,除了static之外,还需要加上final 关键字。但是也可以定义constant instance variable和constant local variable
- Java中易混淆
- Java中易混淆的概念
- Java多线程中易混淆的概念
- java 中易混淆的知识点1
- java中MD5混淆
- Java易混淆知识点
- java 易混淆知识点
- JAVA易混淆总结
- JAVA中几个易混淆关键词的理解
- [转帖]JAVA中几个易混淆关键词的正确理解
- java中常见的易混淆问题搜集
- JAVA中几个易混淆关键词的正确理解
- js和java中正则表达式的易混淆点
- 混淆中再混淆
- 中易混淆的数据类型
- Linux中易混淆知识点
- js中易混淆知识点
- php与java易混淆
- java final 关键字
- Android屏幕解锁图案破解
- 点滴
- Android - 文件读写操作总结
- ANSI C++特征总结
- Java中易混淆
- Mysql日期类型大小比较
- Android开发之旅:环境搭建及HelloWorld
- android内核处理机制
- 协方差矩阵之主成分分析
- Easyui widow 控件 宽度调整适应不同分辨率
- SOCKET常用函数简介
- [Linux/Ubuntu] vi/vim 使用方法讲解
- 职业态度