Print stars in console like this using java ?
......*
.....*.*
... *...*
.. *.....*
. *.......*
...*.....*
... *...*
.....*.*
......*
dot = spaces
look to my code just i need to print border not filled shape
import java.util.Scanner;
public class Stars {
public static void main( String args[] )
{
Scanner input = new Scanner(System.in);
int number ;
System.out.print(" Enter Number of Middle Stars : ");
number = input.nextInt();
for (int i = 1; i <= number; i++)
{
for (int j = number; j >= i; j--)
{
System.out.print(" ");
if (j == i)
{
for (int d = 1; d <= i; d++)
{
System.out.print(" ");
System.out.print("*");
}
}
}
System.out.println("");
}
for (int i = number-1; i >= 1; i--)
{
for (int j = number; j >= i; j--)
{
System.out.print(" ");
if (j == i)
{
for (int d = 1; d <= i; d++)
{
System.out.print(" ");
System.out.print("*");
}
}
}
System.out.println("");
}
}
}