test java intermédiaire

2018-12-15  本文已影响0人  isepien

Language:Java; niveau:Intermédiaire


finalize()

Object
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

equals() vs hashcode()

the contract of the hashcode() defined in the Object class is as follows:
1.If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
2.It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.
3.Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer,

Reflect Java Iterator StringBuilder vs StringBuffer
上一篇 下一篇

猜你喜欢

热点阅读