answersLogoWhite

0

Cat oldCat = new Cat(); Cat newCat = new Cat(); Cat oldCatRef = oldCat;

In the above example, oldCat and oldCatRef are references to the same object. Since they refer to the same object, their hashcodes will be equal.

But oldCat and newCat do not refer to the same object. They are references to two different objects. But they might have the same hashCode based on their implementation. hashCode is simply a method in Object class which you can override.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the difference between a hash set and a linked hash set?

The only difference is that the LinkedHashSet maintains the order of the items added to the Set but HashSet doesn't maintain any order.


What difference does it make if you remove a period in a hash?

It makes a big difference because if you compared the hash: abcde.fg = hash 1 to abcdefg = hash 3 The results hash 1 and hash 3 are not equal.


What is the difference between hash browns and fancy hash browns?

Not really anything. I've never heard of fancy hash browns but they sound more detailed and have a better taste.


What is the difference between AES Rijndael symmetric algorithm encryption and a hash algorithm?

678


What are the differences between the NFL hash marks and college hash marks on a football field?

The main difference between NFL and college hash marks on a football field is their width. In the NFL, the hash marks are narrower, measuring 18 feet 6 inches apart, while in college football, the hash marks are wider, measuring 40 feet apart. This difference affects the positioning of the ball for plays and can impact game strategies.


What is hash collision?

Hash collision means....2 different keywords having the same hash code. Yes its as simple as that........


What is the difference between a period and a hash symbol in declaring CSS classes?

Period which specifies to a class using (.) or dot operator Where as hash or # specifies to id of a particular attribute of HTML tags


Define hashing and describe briefly including types of hashing and where it is used and advantages and disadvantages of hashing?

Hashing is performed on arbitrary data by a hash function. A hash function is any function that can convert data to either a number or an alphanumeric code. There are possibly as many types of hashing as there are data. How precisely the hash function works depends on what data it is meant to generate a hash code from. Hashing is used for a variety of things. For example, a hash table is a data structure used for storing data in memory. Instead of iterating through the structure to find a specific item, we associate a key (hash code) to a particular item (data). A hash code can be generated from a file or disk image. If the data does not match the code, then the data is assumed to be corrupted. Hashing has the advantage of taking a larger amount of data and representing it as a smaller amount of data (hash code). The code generated is unique to the data it came from. Generating a hash code can take time however, depending on the function and the data. Some hash functions include Bernstein hash, Fowler-Noll-Vo hash, Jenkins hash, MurmurHash, Pearson hashing and Zobrist hashing.


What is the best way of referring to the output of a secure hash function?

The output from a hash function is referred to as the hash value, hash code, hash sum, checksum or just plain "hash" as in "the hash of the file is...". Generally a hash function is presumed to be secure or it wouldn't be used. If a hash is not secure it could be referred to as "worthless" or "false sense of security".


What is the difference between marijuana and hashish?

Hash is weed...Just pretty strong hash is actually made from the tippy top of the marijauna bud, some people consider the small particles that fall into the pollen catcher of a grinder to be hash, but true hash is bought in a medical marijuana dispensary


What are the different types of hash and how do they differ from each other?

There are mainly two types of hash: bubble hash and traditional hash. Bubble hash is made using ice water and agitation, resulting in a cleaner and more potent product. Traditional hash is made by compressing resin glands from the cannabis plant, giving it a stronger flavor and aroma. The main difference between the two is the method of extraction and the final product's texture and potency.


Is there a difference between Bustelo Instant espresso coffee and bustelo tipo espresso coffee?

Yes, one has cocaine in it. The other has hash.