JavaFX != Java
Yannick | August 31, 2009Today I found out about a small difference between JavaFX and Java… Small, but it can be annoying if you’re – like me – a Java developer.
The == operator in Java is used to compare if two objects are actually the same instance. To check if the are considered equal (logically), you use .equals().
In JavaFX apparently, it’s the other way around !
== checks for logical equality and .isSameObject() is used to see if two objects are the same instance.
I’ll try and remember it, but I’m sure that i’ll make some mistakes before doing it correctly … and I’m pretty sure I’m not the only JavaFX developer with a Java background who’ll have problems with it …






