java homework lection 4 necessary tasks