Here is the code for that:
class NumberTriangle
{
public static void main(String[] args)
{
int i, j=0, k=0;
while(k<=15){
for(i=0;i<=k;i++)
{
System.out.print(" ");
}
for(i=0;i<=15-k;i++)
{
System.out.print(j+" ");
}
System.out.println();
k++;
j++;
if(j>9)
j=0;
}
}
}