正在加载图片...
Runtime errors mport javax. swing. vOptionpane; public class Test public static void (String [] args)t String input JoptionPane show InputDialog(null Please enter an integer) int number nteger parse If an exception occurs on this line. the rest lines in the method / Display the result are skipped and the program is terminated JOptionPane showMessageDialog(null The number entered is+ number) System. exit(0) V Terminated duction to JavaLiang,Introduction to Java Programming,revised by Dai-kaiyu 4 Runtime Errors import javax.swing.JOptionPane; public class Test { public static void main(String[] args) { String input = JOptionPane.showInputDialog(null, "Please enter an integer"); int number = Integer.parseInt(input); // Display the result JOptionPane.showMessageDialog(null, "The number entered is " + number); System.exit(0); } } If an exception occurs on this line, the rest lines in the method are skipped and the program is terminated. Terminated
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有