java base exercise