import javax.swing.*; public class DebuggingEx1 { public void TestOne() { int x = 2, y = 0; System.out.println("Div: " + (x/y)); System.out.println("Prod: " + (x*y)); } public void TestTwo() { int[] data = {10, 20, 30, 40, 50}; for (int i=0; i<=data.length; i++) { System.out.println(data[i]); } } public static void main(String[] args) { DebuggingEx1 ex = new DebuggingEx1(); String choice = JOptionPane.showInputDialog("Which test (1 or 2)?"); if (choice.equals("1")) { ex.TestOne(); } else { ex.TestTwo(); } } }