JFXperience.com

My thoughts on JavaFX, Java, RIA and other stuff …
  • rss
  • Home
  • About
  • Contact
  • RadioFX
  • TelemeterFX

JavaFX != Java

Yannick | August 31, 2009

Today 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 …

Categories
Java, JavaFX
Tags
Java, JavaFX
Comments rss
Comments rss
Trackback
Trackback

« RadioFX Widget Interesting Article! »

One Response to “JavaFX != Java”

  1. Bart says:
    September 2, 2009 at 9:00 am

    Thanks, I’ll try remember that as well.

Leave a Reply

Click here to cancel reply.

Navigation

  • General
  • Java
  • JavaFX

Search

Archives

  • November 2009
  • September 2009
  • August 2009

Links

  • Blogroll
    • JFXStudio
    • LearnJavaFX
    • SteveOnJava
  • JavaFX
    • JavaFX
    • jfxtras
    rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox