夢想飛翔

          自強不息
          posts - 111, comments - 30, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          /* * 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);
              }

          }


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 建阳市| 东明县| 手机| 门源| 白玉县| 溆浦县| 司法| 房产| 南京市| 南雄市| 玛纳斯县| 诸城市| 巴里| 平塘县| 梁山县| 浦北县| 株洲县| 西平县| 红安县| 青田县| 三明市| 农安县| 抚远县| 张家川| 淳化县| 潮州市| 扎鲁特旗| 崇礼县| 曲松县| 张家港市| 黔南| 孟州市| 马关县| 安国市| 潜江市| 马山县| 宣威市| 绥江县| 富平县| 屏山县| 谢通门县|