Practicing java programming