1. frame.setLocationRelativeTo(null); 2. frame.setSize(100, 200); 3. frame.setVisible(true);

The correct order of the following three statements is ___________.


1. frame.setLocationRelativeTo(null);
2. frame.setSize(100, 200);
3. frame.setVisible(true);


A. 1 2 3
B. 1 3 2
C. 2 1 3
D. 3 2 1

The correct answer is C

Explanation: setSize method should be invoked before invoking setLocationRelativeTo(null). Mistakes are made in the 6E book. Thanks to Elnur from Russia for the correction.


Java

Learn More Multiple Choice Question :