Here you can find the source of format(int num)
private static String format(int num)
//package com.java2s; //License from project: Open Source License public class Main { private static String format(int num) { return (num < 10 ? "0" : "") + num; }//from w ww. j a v a 2 s .c om }