第一种:使用%s

System.out.println(String.format("%d%s", 50, "%"));//50%

第二种:使用%%对%进行转义

System.out.println(String.format("%d%%", 50));//50%