solution code for chapter4
Merge pull request #175 from jintaoguan/master

java code for chapter4