





























Teach students to make a Java program jump straight to one record in a file and read or change it without reading the rest. Students learn how a RandomAccessFile saves numbers as bytes and find where each locker record starts. In our online code lab, they use seek() to jump to one seat record, read it and then change its price in place.
● Instant download · Lifetime access · Editable & print-ready
Short coding levels practice this lesson in CodeGrove, our code lab that runs in the browser. Students write the program, run it and check it, with no account and nothing to install. Use them with the lesson or as practice later.
See the levels→Students may think seek(3) jumps to the third number, or that changing one price means writing the whole file again. This lesson has them work out where each record starts from its size in bytes. Then they change one value in place.
The try-it on Day 1, the lab on Day 2 and the quiz task on Day 3 run online in CodeGrove, our in-browser code lab, so students need a computer or tablet on those days. The Seat Records level practices jumping to one seat record with seek() to read it, then changing its price in place. CodeGrove is free, with no accounts, sign-ins or installs.
Students jump to one seat record to read it, then change its price in place, in CodeGrove.
Every record takes the same number of bytes, so students can work out the byte where any record starts.
They use seek() to reach the price inside one seat record and write the new price over the old one, so the other records stay the same.
Every page is a print-ready PDF, and the Google Forms™ and Google Slides™ let you teach the same lesson in Google Classroom™.
Students write and run real Java in CodeGrove, our in-browser code lab, on a computer or tablet, with no accounts or installs.
Every day has its own answer key, and every written question has a sample answer and what to look for.
Each day's plan is timed activity by activity against real reading and writing speeds.
Reviews help me a lot, and they help other teachers pick the right resources for their classes. It takes about a minute.
Leave a reviewInstant download right after checkout: PowerPoint and Word files you can edit, print-ready PDFs, and links that copy the Google Forms™ and Google Slides™ into your Drive.
Yes. This lesson is part of the Unit 5 bundle and the complete Java Programming course. Both cost less than buying the lessons one at a time.
No. It is a full-year, non-AP Java course for grades 9 to 12, and it is not built for the AP exam. For AP, see our AP Computer Science A and AP CSP courses.
Students can write and read text files.
Yes, on the CodeGrove days. Each student needs a computer or tablet that's online, and CodeGrove needs no account or install. The bell ringers, notes, exit tickets and quiz are on paper.
Every page is a print-ready PDF. The slides are an editable PowerPoint and the guided notes an editable Word file. The exit tickets and the quiz also come as Google Forms™, and the deck as Google Slides™.
Written for Florida's Advanced Programming course (9007230). The skills map in the lesson shows which standards each day teaches.