|
| 1 | +package com.saurabh.java; |
| 2 | + |
| 3 | +public class MarkdownDoc { |
| 4 | + |
| 5 | + /// Returns a hash code value for the object. This method is |
| 6 | + /// supported for the benefit of hash tables such as those provided by |
| 7 | + /// [java.util.HashMap]. |
| 8 | + /// |
| 9 | + /// The general contract of `hashCode` is: |
| 10 | + /// |
| 11 | + /// - Whenever it is invoked on the same object more than once during |
| 12 | + /// an execution of a Java application, the `hashCode` method |
| 13 | + /// must consistently return the same integer, provided no information |
| 14 | + /// used in `equals` comparisons on the object is modified. |
| 15 | + /// This integer need not remain consistent from one execution of an |
| 16 | + /// application to another execution of the same application. |
| 17 | + /// - If two objects are equal according to the |
| 18 | + /// [equals][#equals(Object)] method, then calling the |
| 19 | + /// `hashCode` method on each of the two objects must produce the |
| 20 | + /// same integer result. |
| 21 | + /// - It is _not_ required that if two objects are unequal |
| 22 | + /// according to the [equals][#equals(Object)] method, then |
| 23 | + /// calling the `hashCode` method on each of the two objects |
| 24 | + /// must produce distinct integer results. However, the programmer |
| 25 | + /// should be aware that producing distinct integer results for |
| 26 | + /// unequal objects may improve the performance of hash tables. |
| 27 | + /// |
| 28 | + /// @return a hash code value for this object. |
| 29 | + /// @implSpec As far as is reasonably practical, the `hashCode` method defined |
| 30 | + /// by class `Object` returns distinct integers for distinct objects. |
| 31 | + /// @see java.lang.Object#equals(java.lang.Object) |
| 32 | + /// @see java.lang.System#identityHashCode |
| 33 | + void md() { |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * Returns a hash code value for the object. This method is |
| 38 | + * supported for the benefit of hash tables such as those provided by |
| 39 | + * {@link java.util.HashMap}. |
| 40 | + * <p> |
| 41 | + * The general contract of {@code hashCode} is: |
| 42 | + * <ul> |
| 43 | + * <li>Whenever it is invoked on the same object more than once during |
| 44 | + * an execution of a Java application, the {@code hashCode} method |
| 45 | + * must consistently return the same integer, provided no information |
| 46 | + * used in {@code equals} comparisons on the object is modified. |
| 47 | + * This integer need not remain consistent from one execution of an |
| 48 | + * application to another execution of the same application. |
| 49 | + * <li>If two objects are equal according to the {@link |
| 50 | + * #equals(Object) equals} method, then calling the {@code |
| 51 | + * hashCode} method on each of the two objects must produce the |
| 52 | + * same integer result. |
| 53 | + * <li>It is <em>not</em> required that if two objects are unequal |
| 54 | + * according to the {@link #equals(Object) equals} method, then |
| 55 | + * calling the {@code hashCode} method on each of the two objects |
| 56 | + * must produce distinct integer results. However, the programmer |
| 57 | + * should be aware that producing distinct integer results for |
| 58 | + * unequal objects may improve the performance of hash tables. |
| 59 | + * </ul> |
| 60 | + * |
| 61 | + * @return a hash code value for this object. |
| 62 | + * @implSpec As far as is reasonably practical, the {@code hashCode} method defined |
| 63 | + * by class {@code Object} returns distinct integers for distinct objects. |
| 64 | + * @see java.lang.Object#equals(java.lang.Object) |
| 65 | + * @see java.lang.System#identityHashCode |
| 66 | + */ |
| 67 | + void javadoc() { |
| 68 | + } |
| 69 | +} |
0 commit comments