i need to print stars on console like this

* * * * * * * *
* $ $ $ $ $ $ *
* $ $ $ $ $ $ *
* $ $ $ $ $ $ *
* $ $ $ $ $ $ *
* $ $ $ $ $ $ *
* * * * * * * *

.* * * * * * * *
..* $ $ $ $ $ $ *
...* $ $ $ $ $ $ *
.....* $ $ $ $ $ $ *
.......* $ $ $ $ $ $ *
.........* $ $ $ $ $ $ *
........... * * * * * * * *

dot = spaces

for-loop that adds spaces equal to the number of row currently printing.
Also use for loop to display the number of "*"

Displays N spaces

for (int i=0;i<N;i++) {
   System.out.print(" ");
}
import java.util.Scanner;
public class Shape {

	public static void main(String[] args) {
		Scanner input =new Scanner(System.in);
		int width ;
		System.out.println("enter width :");
		width =input.nextInt();
		for(int i=1 ; i<=width ; i++)
		{
			for (int j=1 ; j<=width; j++)
			{
				
				
				if((i==1 || i==width) || (j==1 || j==width))
				{
					
					System.out.print(" * ");
				
				
				}
		
				else
				{
					System.out.print(" $ ");
				}
		
			}
			
			System.out.println();
				
		
			

		}
		
	}

}

now JUST spaces ?????????
* * * * * * * *
..* $ $ $ $ $ $ *
...* $ $ $ $ $ $ *
.....* $ $ $ $ $ $ *
.......* $ $ $ $ $ $ *
.........* $ $ $ $ $ $ *
........... * * * * * * * *
dot = spaces

Before each row, meaning at the beginning of each row you need to print before the first '*' the spaces. How many spaces will depend on the row you are now. I believe it is the 'i' that counts the rows. So the 1st row will have 0 spaces, the 2nd row will have 1 space.
And I gave you code for printing spaces.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.