设为首页 加入收藏

TOP

两种keyboardinput方法
2011-06-09 13:11:05 来源: 作者: 【 】 浏览:432次 评论:0

import java.io.*;

class Keyboardwrite{
publicstaticvoid main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("input the data:");
String line = br.readLine();
System.out.print("data from keyboard:"+line);

}
}

import java.io.*;
import java.util.*;

class Keyboardwrite{
publicstaticvoid main(String[] args) throws IOException{
Scanner s = new Scanner(System.in);
System.out.print("input the data:");
String line = s.nextLine();
System.out.print("data from keyboard:"+line);
}
}
您看到此篇文章时的感受是:
Tags: 责任编辑:administrator
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到QQ空间
分享到: 
上一篇1的平方-2的平方+3的平方-4的平方.. 下一篇三位数中个,十,百位数的立方和..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

相关栏目

最新文章

图片主题

热门文章

推荐文章

相关文章

广告位