Part III: Multiple Choice Questions: (1 pts each)
(Please circle your answers on paper first. After you
finish the test, enter your choices online to LiveLab. Log
in and click Take Instructor Assigned Quiz. Choose Quiz3.
You have 5 minutes to enter and submit the answers.)
1
What is the output of the following code?
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
public class Test {
public static void main(String[] args) {
IntegerProperty d1 = new SimpleIntegerProperty(1);
IntegerProperty d2 = new SimpleIntegerProperty(2);
d1.bind(d2);
System.out.print(“d1 is ” + d1.getValue()
+ ” and d2 is ” + d2.getValue());
d2.setValue(3);
System.out.println(“, d1 is ” + d1.getValue()
+ ” and d2 is ” + d2.getValue());
}
}
A. d1 is 1 and d2 is 2, d1 is 1 and d2 is 3
B. d1 is 2 and d2 is 2, d1 is 2 and d2 is 3
C. d1 is 1 and d2 is 2, d1 is 3 and d2 is 3
D. d1 is 2 and d2 is 2, d1 is 3 and d2 is 3
#
2
Analyze the following code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.geometry.Insets;
import javafx.stage.Stage;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
public class Test extends Application {