all,I\'m now facing the problem of no idea on storing the content in text file into the array. The situation is like, text file content:
abc1
xyz2
rxy3
You can use this full code for your problem. For more details you can check it on appucoder.com
class FileDemoTwo{
public static void main(String args[])throws Exception{
FileDemoTwo ob = new FileDemoTwo();
BufferedReader in = new BufferedReader(new FileReader("read.txt"));
String str;
List list = new ArrayList();
while((str =in.readLine()) != null ){
list.add(str);
}
String[] stringArr = list.toArray(new String[0]);
System.out.println(" "+Arrays.toString(stringArr));
}
}