i recently bumps into this code below when exploring javafx, i see that ObservableList is an interface and there is no implementation of it, how can you use a variable of it ? obvious i am missing something here, can anyone point me to right direction?
List list = new ArrayList(); ObservableList observableList = FXCollections.observableList(list); observableList.addListener(new ListChangeListener() { @Override public void onChanged(ListChangeListener.Change change) { System.out.println("Detected a change! "); } });
I think this code:
means this method get a implementation of the interface, you can download the source to check it.