February 2014
Beginner
1248 pages
62h 25m
English
Method displayState (lines 57–86) outputs the application’s state. Lines 63–64 output the values of the buffer cells. Line 64 uses method printf with a "%2d" format specifier to print the contents of each buffer with a leading space if it’s a single digit. Lines 71–83 output the current writeIndex and readIndex with the letters W and R, respectively. Once again, displayState is a synchronized method because it accesses class CircularBuffer’s shared mutable data.
Read now
Unlock full access