Object Oriented Java Code