Question: /* Complete the missing line. For this question only, only write the missing line. The program should print: d1 is 3 and d2 is 3
/*
Complete the missing line. For this question only, only write the missing line. The program should print:
d1 is 3 and d2 is 3
d1 is 5 and d2 is 5
d1 is 7 and d2 is 7
*/
import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; public class DataBinding { public static void main(String[] args) { IntegerProperty d1 = new SimpleIntegerProperty(1); IntegerProperty d2 = new SimpleIntegerProperty(3); //COMPLETE THE CODE System.out.println("d1 is " + d1.getValue() + " and d2 is " + d2.getValue()); d1.setValue(5); System.out.println("d1 is " + d1.getValue() + " and d2 is " + d2.getValue()); d1.setValue(7); System.out.println("d1 is " + d1.getValue() + " and d2 is " + d2.getValue()); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
