thingol
String.format ("%010d", 45075)
Matheus_Tardivo
Class DecimalFormat.
Exemplo:
import java.text.DecimalFormat;
class TestDecimalFormat {
public static void main(String[] args) {
int i = 45075;
System.out.println(new DecimalFormat("[telefone removido]").format(i));
}
}
[edit]
Não tinha visto o post do thingol. Mais simples… :oops:
[/edit]
Rafael_Afonso
Olá:
Use a classe java.text.DecimalFormat. Exemplos aqui.
Grato,
thiago.correa
Hum, acho que você vai ter que criar algo do tipo
private String fillWithZero(Integer i) {
int qutde = 10 - i.toString().length();
StringBuffer texto = new StringBuffer("");
for (int j = 0; j < qutde; j++) {
texto.append("0");
}
return texto.append(i.toString()).toString();
}
[edit]
e eu nenhum dos posts anteriores 
[/edit]
sudeval
vlw galera, vou de Decimal Format, pq o exemplo do Thingol se eu nao me engane so vai me servir no java 5, e nao estou usando ele.
thingol
Se vai usar em um relatório, e vai usar Java 1.4 ou anterior, use a dica do Matheus Tardivo mesmo.
rafaelbrizola
Só não se esqueça q o Integer só aguenta até [telefone removido], ou seja, pode ser q o seu integer com 10 digitos estoure heheheh…