Java Question & Solution