java-se object
2017-07-29 08:11
417 查看
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,
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,
相关文章推荐
- JAVA_SE基础——60.初识Object
- java_se Object
- Hibernate:java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to co
- Java顶级父类Object
- error occurred during initialization of vm java/lang/noclassdeffounderror java/lang/object
- 【典型错误】The type java.lang.Object cannot be resolved.
- JSON详细学习之JSONObject in JAVA
- javaSE Swing 按钮文本框触发事件
- Java SE Demos and Samples 阅读笔记(1.1 db)
- java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/Str
- Java(SE)与C++之我见(大学的时候写的)
- java.lang.Object[] java.util.Collection.toArray()
- java并发-Condition与Object.wait()、Object.notify()
- Java之IO(七)ObjectInputStream和ObjectOutputStream
- JSONObject.fromObject(map)(JSON与JAVA数据的转换)
- Java NIO框架Netty教程(三) – Object对象传递
- Java SE/ME/EE的概念介绍
- Java Object类方法
- Ajax/JavaScript学习随笔:java script Object Notation(JSON)
- Java中Object的clone()及浅拷贝、深拷贝分析