1. 程式人生 > >201671010132 2017-2018第11周Java學習總結

201671010132 2017-2018第11周Java學習總結

它的 pat trace exc catch while 什麽 out paths

try {
in = new Scanner(Paths.get("H:\\data1.txt"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while (in.hasNext())
{
String word = in.next();
long callTime = System.currentTimeMillis();
words.add(word);
callTime = System.currentTimeMillis() - callTime;
totalTime += callTime;
}

Iterator<String> iter = words.iterator();
for (int i = 1; i <= 20 && iter.hasNext(); i++)
System.out.println(iter.next());

這段程序是什麽意思?它的作用是什麽呢

201671010132 2017-2018第11周Java學習總結