Let the mass of the floating ice = m. The mass of the displaced water is also equal to m. The volume of the displaced water = m/d, where d is the density of the water. Now when the whole ice cube melts its mass *** the same =m and now its density is also equal to d. The volume of the melted ice cube =m/d which is the same as the initially displaced water. So the volume of the water will not change and the water will not overflow when the ice cube melts.