I have this code

```
class A
{
 public static void main(String reds[])
  {
    A ob=new A();
    System.out.println("Object "+ob);
    System.out.println("HashCode "+ob.hashCode());
  }
}

```

Output is:
[Output image](https://i.stack.imgur.com/h2aCR.png)

The output for above code gives different value most of the time. 
Also, the below link mentions that printing a reference variable prints *ClassName@hashcode*.

[printing reference variable is not printing the object's address](https://stackoverflow.com/questions/16757390/printing-reference-variable-is-not-printing-the-objects-address)

However, the output for printing reference varibale differs from hashCode().What is actually happening here?

Just wanted to clear my concepts of hashcode in java.