Java tutorial
//package com.java2s; public class Main { public static String addPrefixHtmlSpace(int num) { return addPrefix(num, " "); } public static String addPrefixHtmlSpace(String numStr) { return addPrefix(numStr, " "); } public static String addPrefix(int num, String prefix) { return num < 10 ? prefix + num : String.valueOf(num); } public static String addPrefix(String numStr, String prefix) { int num = Integer.parseInt(numStr); return addPrefix(num, prefix); } }