Update JavaCode

Updated class to reflect output