JAVA在命令行界面中进行输入数据的方法
2012-01-02 18:38
465 查看
How to input your personal data from the default command interface.
It used the System.in.read, contrast to the System.out.print.
It used the System.in.read, contrast to the System.out.print.
package com.han; import java.io.*; /** * How to input your personal data from the default command interface. * <p> * It used the System.in.read, contrast to the System.out.print. * @author han * */ public class InputSystem{ public static void main(String args[]){ byte[] buffer=new byte[512]; try { System.out.print("请你输入: "); System.in.read(buffer);//input your data, and ends with a "Return" key. } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } String str=new String(buffer); System.out.println("what you input is : "+str); } }
相关文章推荐
- JAVA在命令行界面中进行输入数据的方法
- JAVA在命令行界面中进行输入数据的方法
- java方法重载实验:判断键盘输入的两个数据的类型后进行比较
- 10007---Java中从控制台输入数据的几种常用方法
- Java中从控制台输入数据的常用方法
- Java中从控制台输入数据的几种常用方法
- Java:集合,对列表(List)中的数据(整型、字符串、日期等)进行排序(正序、倒序)的方法;字符串按照整型排序的方法
- Java,从控制台中输入数据的方法——Scanner
- java获取键盘输入的数字,并进行排序的方法
- 在Java中使用键盘输入数据的几种方法
- Java通过MyBatis框架对MySQL数据进行增删查改的基本方法
- Java中从控制台输入数据的几种常用方法(转)
- java对实体类列表进行方法内排序,不修改数据查询方式
- java用post方法获取json数据,与服务器进行交互
- Java中从控制台输入数据的几种常用方法
- Java中从控制台输入数据的几种常用方法
- Java中从控制台输入数据的几种常用方法
- Java中从控制台输入数据的几种常用方法
- Java学习笔记之[ 利用扫描仪Scanner进行数据输入 ]
- 详细整理Java 从命令控制台输入数据读取输入流System.in的几种常用方法