import java.util.Scanner;
public class Triangle
{
	static int num;
	static int s;
	static int y;
	public static void star()
	{
		System.out.print("*");
	}
	public static void space()
	{
		System.out.print(" ");
	}
	public static void in()
	{
		Scanner input = new Scanner(System.in);
		num = input.nextInt();
		s = num + (num - 1);
		y = (s/2) + 1;
	}
	public static void one () 
	{
		for (int i = 1; i <= s; i++)
		{
			if ( i == y)
			star();
			else 
			space();
		}
	}
	public static void end()
	{
		for (int i = 1; i <= s; i++)
			star();
	}
	public static void body()
	{
		for (int z = 1; z <= y-2; z++)
		{
			for (int b = 1; b <= s; b++)
			{
				if( b == y+z || b == y-z)
				{star();}
				else
				{space();}
			}
		System.out.print("\n");	
		}
	}
	public static void main(String[] args)
	{
		System.out.println("Enter your number : ");
		in();
		one();
		System.out.print("\n");
		body();
		end();
		
	}
}

@@ -904,14 +904,576 @@
 nd();%0A%09%09
+System.out.println(%22 %22);%0A%09%09System.out.println(%22Do you want that again?(y/n)%22);%0A%09%09Scanner input = new Scanner(System.in);%0A%09%09String dess = input.nextLine();%0A%09%09if(dess.equals(%22y%22))%0A%09%09while(dess.equals(%22y%22))%0A%09%09%7B%0A%09%09System.out.println(%22Enter your number : %22);%0A                in();%0A                one();%0A                System.out.print(%22%5Cn%22);%0A                body();%0A                end();%0A                System.out.println(%22 %22);%0A%09%09System.out.println(%22Do you want that again?(y/n)%22);%0A                dess = input.nextLine();%0A%0A%09%7D %0A%09%09System.out.println(%22Thank you!%22);%0A
 %0A
-%09
 %7D%0A%7D%0A

Update Triangle.java