Java basics homeworks