First task of Java course project