[20160704]Addition program that use JOptionPane for input and output
2016-07-04 21:57
585 查看
1 //Addition program that use JOptionPane for input and output. import javax.swing.JOptionPane; public class Addition{ public static void main(String[] args) { String firstNumber=JOptionPane.showInputDialog("Enter first integer!"); String secondNumber=JOptionPane.showInputDialog("Enter second integer!"); int num1=Integer.parseInt(firstNumber); int num2=Integer.parseInt(secondNumber); int sum=num1+num2; JOptionPane.showMessageDialog(null,"The sum is:\t"+sum,"sum of two integers",JOptionPane.PLAIN_MESSAGE); } }
相关文章推荐
- python操作linux关机、重启和修改ip地址
- Linux 下 的 cc 和 gcc
- Apache php Mysql部署(一)下载安装
- Spark实战(2)----hadoop集群框架搭建
- 3.2 zabbix 增加客户端监控
- 响应式手机网站要点
- Linux 下开发环境安装配置-编译、解压、超链、
- Linux中的文件特殊权限
- linux模拟iic代码
- 监控
- Linux 进程管理
- 并行程序设计模型
- nginx作为下载文件服务器
- Linux 中配置环境变量等问题
- windows 10 bash change PS1
- ubuntu 64位的机器上执行arm-linux-gcc提示 no such file or directory
- comm命令
- OOP-----类与对象对象
- Centos-pycharm的安装
- 每天一个linux命令(34)--top命令