how to write this in java?

55555*55555
4444***4444
333*****333
22*******22
1*********1

well, for digit=n, you have 2(5-n)+1 = 11-2n stars, so ...