1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. SUN認證考試知識點:java讀取文件內(nèi)容的函數(shù)

        時間:2020-09-26 13:22:08 SUN認證 我要投稿

        SUN認證考試知識點:java讀取文件內(nèi)容的函數(shù)

          public static String readFile(String fileName) {

        SUN認證考試知識點:java讀取文件內(nèi)容的函數(shù)

          String output = "";

          File file = new File(fileName);

          if (file.exists()) {

          if (file.isFile()) {

          try {

          BufferedReader input = new BufferedReader(new FileReader(

          file));

          StringBuffer buffer = new StringBuffer();

          String text;

          while ((text = input.readLine()) != null)

          buffer.append(text + "\n");

          output = buffer.toString();

          } catch (IOException ioException) {

          System.err.println("File Error!");

          }

          } else if (file.isDirectory()) {

          String[] dir = file.list();

          output += "Directory contents:\n";

          for (int i = 0; i < dir.length; i++) {

          output += dir[i] + "\n";

          }

          }

          } else {

          System.err.println("Does not exist!");

          }

          return output;

          }

          public static void main(String args[]) {

          Map ab = new HashMap();

          String str = readFile("C:/AbCircuitInfo");

          String[] temp=str.split("\\n");

          for (int i = 0; i < temp.length; i++) {

          ab.put(temp[i].substring(0,temp[i].indexOf(",")), temp[i].substring(temp[i].indexOf(",")+1,temp[i].length()));

          }

          }

        【SUN認證考試知識點:java讀取文件內(nèi)容的函數(shù)】相關文章:

        SUN認證考試知識點:Java Socket通信讀取相關信息代碼11-05

        Sun java認證考試答案11-12

        Sun Java認證考試科目10-03

        sun java認證考試介紹10-03

        Java如何讀取文件內(nèi)容再編輯10-05

        Java認證考試知識點:Java時間類的函數(shù)10-16

        sun java認證考試報考指南10-03

        SUN JAVA認證介紹05-13

        SUN認證考試知識點:Java反射機制的應用11-05

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>