나는 말도 안되는 말을하지 않을 것입니다. 키 코드는 다음과 같습니다.
package cn.com.songjy; import java.text.numberformat; // java add 0 public class numberformattest {public static void main (string [] args) {// 테스트 할 데이터를 삽입 int i = 1; // numberformat nuppormat nf = numberformat. 최대 정수 숫자 nf.setmaxumImintegerDigits (4); // 최소 정수 숫자 nf.setminimintegerDigits (4); // 출력 테스트 명령문 시스템을 설정합니다. * */ public class testStringformat {public static void main (String [] args) {int younumber = 1; // 0은 이전 보충제 0 // 4를 나타냅니다. 4의 길이는 4의 길이를 나타냅니다. System.out.println (str); // 0001}} // 흐름 번호가 추가되고 흐름 번호가 반환되고 흐름 번호는 4- 프라이버시 정적 최종 문자열 str_format = "0000"입니다. public static string haoaddone_2 (String liushuihao) {Integer inthao = integer.parseint (liushuihao); inthao ++; decimalformat df = new Decimalformat (str_format); return df.format (inthao);};위의 코드는 Java 문자열에 0 또는 공백을 추가하기위한 구현 코드에 관한 것입니다. 아주 좋습니다. 모든 사람에게 도움이되기를 바랍니다. 궁금한 점이 있으면 메시지를 남겨주세요. 편집자는 제 시간에 답장을 드릴 것입니다. Wulin Network 웹 사이트를 지원해 주셔서 대단히 감사합니다!