Last active
December 15, 2019 11:29
-
-
Save kubawieczorek/35d324497b77d263648e02a8ae9477aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Car fiat1 = new Car("Fiat", new BigDecimal(4000)); | |
Car fiat2 = new Car("Fiat", new BigDecimal(4000)); | |
System.out.println(fiat2.hashCode() == fiat1.hashCode()); //false | |
System.out.println(fiat2.equals(fiat1)); //true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment