I'm currently reading up java's IO chapter regarding files and got me wondering what if, there are different data types in a text file, for example:
Position(in type String), ID(in type long), Name(in type String), Birthdate(dd/mm/yy in 3 type ints), title(Ms/Mr/Dr in type String), tasks done(in type int):
file name: employeeInfo.txt
Manager, 987298347, Tesla, 03,04,1969, Mr, 4
Assistant, 290375020, Chris, 17,11,1989, Mr, 5
Manager, 99832482322, Steph, 11,02,1980, Ms, 4
Assistant, 679730283, Pete, 09,10,1980, Mr,7
How do I store them into two ArrayList that are grouped according to their position, in code? In order for me to do any flexible tasks, for example:
1. able to find out which employee achieve task done with more than 3
2. display employee's info when its ID is entered
Then the result may be as follows if 2 is invoked:
input:
290375020
output:
Assistant, 290375020, Chris, 17/11/1989, Mr, 5
I hope there isn't any confusion caused. Thank you in advance