夢想飛翔

          自強不息
          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);
              }

          }

          主站蜘蛛池模板: 泗水县| 虞城县| 长岛县| 哈尔滨市| 赞皇县| 灵武市| 台东县| 栾川县| 瑞丽市| 东莞市| 东安县| 即墨市| 吉水县| 滁州市| 新绛县| 包头市| 中宁县| 太湖县| 望谟县| 中超| 雷波县| 任丘市| 兴宁市| 兴城市| 泸溪县| 都江堰市| 泾川县| 武乡县| 昆明市| 西宁市| 衡水市| 车致| 志丹县| 永寿县| 花莲市| 钦州市| 平度市| 海兴县| 祁连县| 建始县| 无棣县|