Hello,

so my question is this..lets say you have a file
like this.

Computer Science
01 //course number
30 //number of students that can enroll
4 //number of students currently enrolled

Math
02 //course number
20 //number of students that can enroll
12 //number of students currently enrolled

And i have a program that enrolls students in a course..
after a student enrolls, i need to update the file.

so if i enroll in computer science,
the number of students would increase to 5 and look like this

Computer Science
01
30
5

...how do i do that?

You've shown the file contents in text record format. Ie each record ends with a line end. The records can all be different lengths.
To be able to use a RandomAccessFile to get to records randomly, each record must be the same length. Then the position of a record = (recordNbr-1) * record length

Is your data is written to the file with fixed/same length records?

the format is all the same and predictable because i created the file

Ok, then if you know the position/displacement of all the fields you should be able to use RandomAccessFile to update the file.