If you provide a few specific examples of what you’re trying to memorize, people might be able to offer ideas on how to memorize them.
I would start reading the book normally, without focusing too much on memory techniques, writing notes and typing out all the code examples. After the code runs, I would try to explain every detail of the code to an imaginary person to make sure I understand what it’s doing. Then you could add memorization for things that can be put in lists or for any parts that aren’t sticking in memory.
Example: if you find that you aren’t remembering how to create a Java program with an Account class (seen in the table of contents), you could create a journey or story to link together all the steps needed from creating the file, writing the code (getters, setters, or however Java works), to compiling the program and running it.
The process of typing out the code and running it is good for memorization, because there will be bugs and other problems that won’t be apparent just from reading the book. I think that the more painful a bug is, the more memorable the solution will be. ![]()
I was looking through what I could see of the Java book, and you probably don’t need to memorize statements like “constructors cannot return values”. If you work through the exercises, you’ll probably pick up information like that without extra effort.
Memory techniques work well for things that can be put in lists. Here’s an example of a list you might find in a computer science book and how you could memorize it with a simple peg list:
OSI model:
| Peg # | Peg image | Fact | Mnemonic image |
|---|---|---|---|
| 1 | Candle | Physical layer | Burned by a candle while getting a physical at the doctor’s office |
| 2 | Swan | Data link layer | Data from Star Trek tying up a swan with chain links |
| 3 | Butterfly | Network layer | A butterfly getting tangled up in network wires |
| 4 | Sailboat | Transport layer | A sailboat being sent through a Star Trek transporter |
| 5 | Hook | Session layer | A hook lifting up a band at a jam session |
| 6 | Elephant | Presentation layer | An elephant giving a presentation on a projector |
| 7 | Boomerang | Application layer | Throwing a boomerang at a phone (app / application) |
Using spaced repetition on the memorized material will also help.