Java object game