夢想飛翔

          自強不息
          posts - 111, comments - 30, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理
          /* * Created on 2005-4-5
          * * TODO To change the template for this generated file go to
          * Window - Preferences - Java - Code Style - Code Templates
          */


          import java.io.BufferedReader;
          import java.io.IOException;
          import java.io.InputStreamReader;

          /**
          @author Zhangql
          *
          * TODO To change the template for this generated type comment go to
          * Window - Preferences - Java - Code Style - Code Templates
          */

          public class EnterConsole 
          {
              
          public static void main(String[] args) throws IOException
              
          {
                  EnterConsole enterConsole 
          = new EnterConsole();
                  enterConsole.printConsoleChar();
              }

              
          /**
              * 從控制對接收一行字符串,然后輸出到控制臺
              * 
          @throws IOException
              
          */

              
          public void printConsoleLine() throws IOException
              
          {
                  BufferedReader br 
          = new BufferedReader(new InputStreamReader(System.in));
                  String str 
          = null;
                  System.out.println(
          "Enter your value:");
                  str 
          = br.readLine();
                  System.out.println(
          "your value is :"+str);
              }

              
          /**
              * 從控制臺接收一個字符
              * 然后打印到控制臺上
              * 
          @throws IOException
              
          */

              
          public void printConsoleChar() throws IOException
              
          {
                  System.out.print(
          "Enter a Char:"); 
                  
          char i = (char) System.in.read();
                  System.out.println(
          "your char is :"+i);
              }

          }

          主站蜘蛛池模板: 佛山市| 封丘县| 通辽市| 松滋市| 蓬溪县| 中江县| 苗栗县| 湟中县| 牙克石市| 临沧市| 苏尼特左旗| 南京市| 咸宁市| 建昌县| 武隆县| 留坝县| 龙岩市| 泾川县| 水富县| 宁强县| 宜城市| 泸定县| 华容县| 缙云县| 蓬莱市| 江山市| 馆陶县| 渭南市| 宁阳县| 巴彦县| 华亭县| 谷城县| 玉屏| 蕲春县| 板桥市| 长兴县| 嵩明县| 泊头市| 原阳县| 枞阳县| 肇州县|