In C we can do illegal operations because of pointers (by accessing the address of that variable),but in the case of java it won't possible because of JVM ,In java JVM will generate the hash code(address) of the reference(variable), JVM having seperate HashMap to generate the Hash Code(Address)..................... :)