Here you can find the source of readAllCourseNum()
public synchronized static Vector<String> readAllCourseNum() throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Vector; public class Main { public synchronized static Vector<String> readAllCourseNum() throws IOException { File file = new File("D:\\CourseSystemDB\\courseList.txt"); BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); String line;/* ww w .j a v a 2s . c o m*/ Vector<String> v = new Vector<String>(); while ((line = reader.readLine()) != null) { String[] temp = line.split(" "); v.addElement(temp[0]); } reader.close(); return v; } }