+ 1

What is the difference?

Dog dog1= new Dog("Oscar"); Dog dog2= new Dog("Oscar"); System.out.println(dog1==dog2); The result is: false Dog dog1= new Dog("Oscar"); Dog dog2= new Dog("Oscar"); System.out.println(dog1.equals(dog2)); The result is: true?

5th Aug 2020, 8:49 AM
Umidbek
Umidbek - avatar
5 odpowiedzi
+ 2
Thank you RKK for your information.
5th Aug 2020, 9:42 AM
Umidbek
Umidbek - avatar
+ 2
welcome Umidbek ☺️ I hope you've understood.
5th Aug 2020, 9:52 AM
RKK
RKK - avatar
+ 2
Yes, sure thanks
5th Aug 2020, 9:59 AM
Umidbek
Umidbek - avatar
0
JavaGoal.com. Thank you especially for this: https://javagoal.com/string-comparison-in-java/
6th Aug 2020, 6:09 AM
Umidbek
Umidbek - avatar