Question: Complete the code given below to have as successfully compiled code. You cannot erase anything. You will just add missing parts! DO NOT FORGET that
Complete the code given below to have as successfully compiled code. You cannot erase anything. You will just add missing parts! DO NOT FORGET that your design will be part of the evaluation.
public class Question1 {
public static final int UNKNOWN = 0;
public static final int LINUX = 1;
public static final int WINDOWS = 2;
private DialogBox dlg;
private int operating_system;
public Question1(int os_type) {
operating_system = os_type;
}
public void prepareWindow() throws UnknownOSType {
if (operating_system == WINDOWS ) {
dlg = new WindowsDialogBox();
} else if (operating_system == LINUX ) {
dlg = new LinuxDialogBox();
} else
throw new UnknownOSType("Unknown OS Type");
dlg.showDialog();
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
