thinking in java (1)

[size=medium]1. An object has state, behavior and identity.

2. Indeed, one of the challenges of object-oriented programming is to create a one-to-one mapping between the elements in the problem space and objects in the solution space.

3. In a good object-oriented design, each object does one thing well, but doesn't try to do too much.

4. Java uses dynamic memory allocation, exclusively(primitive types). Every time you want to create an object, you use the 'new' operator to build a dynamic instance of that object--on the heap. And the java garbage collecctor will automatically discovers when an object is no longer in use and destroys it.

5. five different places to store data:
a. Registers(inside the processor, no direct control in java)
b. The stack: live in RAM, has direct support from the processor via its stack pointer.
c. The heap: pool of memory where all java objects live
d. Constant storage
f. Non-RAM storage:

6. High-precision numbers: BigInteger and BigDecimal

7. Default values for primitive members. The default values are only what java guarantees when the variable is used as a member of a class.
This guarantee doesn't apply to local variables(i.e. within a method)

8. Methods in java can be created only as part of a class.A method can be called only for an object(except for static methods which can be called for the class, without an object)

9. there will be only one piece of storage for static field, no matter how many object you make(by new operator).

10. As the computer revolution progresses, "unsafe" programming has become one of the major culprits that makes programming expensive.[/size]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值