Chapter 4.How Objects Behave
来源:互联网 发布:clock页面置换算法 编辑:程序博客网 时间:2024/05/22 14:04
Declearing and initializing instance variables
Instance variables always get a default value.If you don’t explicitly assign a value variable,the instance variable still has a value!
The difference between instance and local variables
- Instance variables are declared inside a class but not with a method.
- Local variables are declared within a method.
Comparing variables(primitives or references)
- To copare two primitives ,use the == operator
- You want to know if two reference variables refer to a single obeject on the heap,using the == operator
- You want to know if two object are equal.You need the .equal() method.
声明和初始化实例变量
实例变量有一个缺省的值。如果你没有明确指定变量的值,实例变量会保持那个缺省的值
实例变量和局部变量的区别
- 实例变量被声明在类里而不是方法里
- 局部变量被声明在方法里
比较基本变量与引用变量
- 两个基本变量的比较试用 == 操作符
- 你想知道两个引用变量是否指向同一个对象,使用 == 操作符
- 你想知道两个对象是否相等,使用 .equal()方法
阅读全文
0 0
- Chapter 4.How Objects Behave
- Head First Java_Study Notes_Chapter 4 How Objects Behave
- Chapter 3: Kernel Objects
- Chapter 10 - Programmable Objects
- chapter 6.3: Device Objects
- Chapter 1:Introduction to objects
- Chapter 8:Holding your objects
- chapter 1 Introduction to objects
- Chapter 2 Classes and Objects
- how many java objects?
- How QTP leans objects?
- 【Chapter-1】Creating and destorying objects
- How do human sketch objects?
- How to compile invalid objects
- Chapter 1 How Drupal Works
- behave安装
- How the CLR Creates Runtime Objects
- how to manage Zope objects programmatically.
- vmware虚拟机硬盘空间扩展---解决ubuntu空间不够用的问题
- 智能照明控制系统是如何实现的?
- java基础笔记
- 成年人的世界没有对与错,只有强者与弱者之分
- 文件管理 yum源搭建
- Chapter 4.How Objects Behave
- 百度地图指定区域画边框
- C++双冒号和单冒号的用法区别
- LeetCode 【Operating System】(二)
- 2017-10下旬与2017-11 项目中遇到的问题
- linux基础(十五)文件打包压缩、解压解档
- ubuntu 14.04设置了静态IP不能上网的解决方法
- 搭建开源工程,通过深度卷积网络,把移动设备上的照片提高到单反级别画质
- 十六 Java异常,try...catch...finally执行流程