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:
||Burned by a candle while getting a physical at the doctor’s office
||Data link layer
Data from Star Trek tying up a swan with chain links
||A butterfly getting tangled up in network wires
||A sailboat being sent through a Star Trek transporter
||A hook lifting up a band at a jam session
||An elephant giving a presentation on a projector
||Throwing a boomerang at a phone (app / application)
Using spaced repetition on the memorized material will also help.