Merge pull request #317 from miniway/master

chapter4 java freelance pattern
Fixed else syntax error
Merge pull request #318 from amree/fix-cpp-example

Fixed C++ example syntax error
chapter5 java last value caching