Hello,
This is a well defined code, you can try this
Code:
Public class myclass {
private Collection <Event> e;
/ / The getter in your private member
Public Collection <Event> geteve() {
return e;
}
Public void charger(String file) {
/ / Read the file
BufferedReader mfl = new BufferedReader(new FileReader(file));
String line = null;
while(line = mfl.readLine() != null) {
Event eve = new Event();
eve.setName(row.substring(1,10));
e.add(eve);
}
}
Public static void hand(String[] args) {
myclass MyClass = new myclass();
MyClass.charger("myListEvent.txt");
}
}
Bookmarks