Analyze the following code:
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
public class Test {
public static void main(String[] args) {
| DoubleProperty balance = new SimpleDoubleProperty(); |
| balance.addListener(ov -> |
| System.out.println(2 + balance.doubleValue())); |
}
}
◦ The program would display 4.5 if the balance.set(4.5) is placed before the balance.addLisnter(...) statement.
◦ The program displays 6.5.
◦ The program displays 4.5.
◦ The program would display 6.5 if the balance.set(4.5) is placed before the balance.addLisnter(...) statement.