zoukankan      html  css  js  c++  java
  • Java--从键盘读取

    //从键盘读取
    
    package Demo;
    import java.util.*;
    import java.io.*;
    public class loop {
        public static void main(String[] args) throws IOException{
            BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
            String r = f.readLine();
            System.out.println(r);
        }
    }
    package Demo;
    import java.util.*;
    import java.io.*;
    public class loop {
        public static void main(String[] args) throws IOException{
            BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
            String r;
    //        System.out.println(r);
            do{
                System.out.println("Input.....");
                r = f.readLine();
                System.out.println(r);
            }while (!r.equals("end"));
        }
    }
    package Demo;
    import java.util.*;
    import java.io.*;
    public class loop {
        public static void main(String[] args) throws IOException{
            //使用字节流读取数据
            byte[] bytesdata =  new byte[100];
            System.out.println("Input...");
            try{
                System.in.read(bytesdata);
            }catch (IOException e){
                e.printStackTrace();
            }
            System.out.println("your intput is ");
            for (int i = 0; i < bytesdata.length; i++){
                System.out.print((char)bytesdata[i]);
            }
        }
    }
  • 相关阅读:
    Python反射函数
    类之特性
    ThinkPHP框架基础知识一
    smarty变量调节器与函数
    smarty模板及其应用
    php……流程
    php......权限管理
    php......文件上传
    php......注册审核
    php......留言板
  • 原文地址:https://www.cnblogs.com/shunguo/p/14501720.html
Copyright © 2011-2022 走看看