Java - Practical task - 1