[20160704]Addition program that use JOptionPane for input and output
//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);
}
}
[20160704]Addition program that use JOptionPane for input and output的更多相关文章
- Python - 3. Input and Output
from:http://interactivepython.org/courselib/static/pythonds/Introduction/InputandOutput.html Input a ...
- C lang:character input and output (I/O)
Xx_Introduction Character input and output is by more line character conpose of the text flow Defin ...
- 7. Input and Output
7. Input and Output There are several ways to present the output of a program; data can be printed i ...
- Python Tutorial 学习(七)--Input and Output
7. Input and Output Python里面有多种方式展示程序的输出.或是用便于人阅读的方式打印出来,或是存储到文件中以便将来使用.... 本章将对这些方法予以讨论. 两种将其他类型的值转 ...
- [Python] Print input and output in table
Print the input and output in a table using prettyTable. from prettytable import PrettyTable import ...
- Input and Output File
Notes from C++ Primer File State Condition state is used to manage stream state, which indicates if ...
- [20171128]rman Input or output Memory Buffers.txt
[20171128]rman Input or output Memory Buffers.txt --//做一个简单测试rman 的Input or output Memory Buffers. 1 ...
- Angular4学习笔记(六)- Input和Output
概述 Angular中的输入输出是通过注解@Input和@Output来标识,它位于组件控制器的属性上方. 输入输出针对的对象是父子组件. 演示 Input 新建项目connInComponents: ...
- Java中的IO流,Input和Output的用法,字节流和字符流的区别
Java中的IO流:就是内存与设备之间的输入和输出操作就成为IO操作,也就是IO流.内存中的数据持久化到设备上-------->输出(Output).把 硬盘上的数据读取到内存中,这种操作 成为 ...
随机推荐
- PHP代码质量优化
最近总结了一些平常写PHP代码时的一些优化分享给大家. 1.尽量使用绝对路径 相对路径中会检查很多路径,这时我们可以使用绝对路径,但绝对路径不利于后期维护,所以define定义的时候使用__FILE_ ...
- Only one statement is allowed per batch. A batch separator, such as 'GO', might be required between statements.
When I added the file in VS I forgot to set Build Action = None from the file properties.
- sqlmap注入检测经验0x01
某日偶遇一SQLInjection Point,MSSQL 2008,已开启显错模式. 马上扔进SQLMap跑,一路顺畅,竟然还是SA的权限,心想运气真好,无论如何都拿定了. 数据库,表,列都列出来了 ...
- HttpHandler过滤请求..
记得以前写过一篇..后来找不到了..我自己也忘记怎么弄了.. 在网上找了很多的教程..写的总有瑕疵..感觉不顺畅.. 自己来一篇.. 其实很简单.. 先建立一个类 继承并实现接口 IHttpHand ...
- target 事件属性
定义和用法 target 事件属性可返回事件的目标节点(触发该事件的节点),如生成事件的元素.文档或窗口. 语法 event.target 实例 下面的例子可获得触发事件的元素: <html&g ...
- [设计模式] javascript 之 桥接模式
桥接模式说明 定义:分离抽象化与实现化,使之可以自由独立的变化: 说明:由于软件环境需求原因,使得类型抽象具有多种实现以自身变化定义等情况,这使得我们要分离抽象实现与具体实现,使得抽象化与实现化解耦, ...
- Linux运维初级教程(三)文件及目录权限
文件类型 -代表普通文件,d代表目录,l代表链接文件,b或c代表设备. 第二至九个字符代表权限,分别为所有者权限.所属组权限.其他账户权限 修改权限用chmod u用户 g组 o其他用户 a所有人 c ...
- SqlServer 还原他服数据库只建立发布却删除不了
本想做测试,从另一台服务器备份数据库还原到本机. 创建了一个发布,却删除不了,提示如下图: 参考论坛:http://bbs.csdn.net/topics/300046417 发现是数据库所有者问题, ...
- 《JavaScript DOM 编程艺术(第2版)》读书笔记
阅读了本书第五章关于使用JavaScript的最佳实践,大部分的建议之前都有耳闻,不过阅读之后有更深的体会. 1.防止滥用JavaScript “不管你想通过JavaScript改变哪个网页的行为,都 ...
- iOS之下拉放大,上推缩小,一个方法搞定
先来看看效果吧. 讲讲大概的实现思路:1、创建头部的视图和tableview,需要注意的是tableview要设置contentInset,contentInsent 的顶部要和头部视图的背景图的高度 ...