[20160704]Addition program that use JOptionPane for input and output

Posted 娃哈哈哈

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[20160704]Addition program that use JOptionPane for input and output相关的知识,希望对你有一定的参考价值。

 1 //Addition program that use JOptionPane for input and output.
 2 
 3 import javax.swing.JOptionPane;
 4 
 5 public class Addition{
 6    public static void main(String[] args) {
 7      String firstNumber=JOptionPane.showInputDialog("Enter first integer!");
 8 
 9      String secondNumber=JOptionPane.showInputDialog("Enter second integer!");
10 
11      int num1=Integer.parseInt(firstNumber);
12      int num2=Integer.parseInt(secondNumber);
13 
14      int sum=num1+num2;
15 
16      JOptionPane.showMessageDialog(null,"The sum is:\t"+sum,"sum of two integers",JOptionPane.PLAIN_MESSAGE);
17 
18    }
19 }

 

以上是关于[20160704]Addition program that use JOptionPane for input and output的主要内容,如果未能解决你的问题,请参考以下文章

20160704世界那么大还是遇见你

Linux之SSL安全套接字20160704

Linux之socket套接字编程20160704

LeetCode Range Addition

如何解决“'mathfilter'标签'addition'在复制django项目后停止工作”错误?

LeetCode Range Addition II