java-se object

object 是 java 基类;

object 有clone, hashcode,equals,notify,notifyall, wait 等方法

以下 讨论默认提供的方法,重写的方法 pass;

clone :a native function,u can't use directly;direct use will clone a object from super class; and throw out CloneNotSupportedException

u need  implements Clonenable interface, it will be work fine;

hashcode : default return is memory address;

collection applying this feature, to store the elements;first calculate hash-code and set it to the addr(hash-code address);

 equals: checking object address whether equal;(== is checking param equal and equals func is checking object )

more simply -> equals compare the object contents , == compare object memory address;


the relation between hashcode and equals;

if 2 object equals it has same hashcode;

if 2 object not equals it is also can have same hashcode (case: hash conflict)


wait,notify,notifyall :thread operating function, wait will give up the thread lock,

 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值