add null to string in java chapter 3