Java Practice with/without Parameters