You could create a DecimalFormat. That would allow you to format a number into a string using your own formatting rules. In this case, it is formatting it to be a 10 digit number that includes preceding zeros.
String ph = "0412456839";
Long n = Long.parseLong(ph);
String formattedN = new DecimalFormat("0000000000").format(n);
System.out.println(formattedN);
if you are using Apache Commons, you can use:
int paddingLength = 10;
String paddingCharacter = "0";
StringUtils.leftPad("" + n, paddingLength, paddingCharacter);