Core java practice