av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

SUN認(rèn)證

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

時間:2024-09-10 00:47:46 SUN認(rèn)證 我要投稿
  • 相關(guān)推薦

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

  public static String readFile(String fileName) {

SUN認(rèn)證考試知識點(diǎn):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認(rèn)證考試知識點(diǎn):java讀取文件內(nèi)容的函數(shù)】相關(guān)文章:

Sun java認(rèn)證考試答案10-23

Sun認(rèn)證Java開發(fā)員考試介紹06-25

java認(rèn)證考試培訓(xùn)內(nèi)容08-21

sun java認(rèn)證考試題庫09-04

sun認(rèn)證java程序員考試科目10-01

sun認(rèn)證java程序員08-05

sun認(rèn)證java基礎(chǔ)模擬試題09-16

sun認(rèn)證java程序員考試試題09-13

Sun認(rèn)證Java程序員考試技巧分享09-14

SUN認(rèn)證考試流程08-22