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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started