Problem :
Write a program to solve given pattern .
Solution :
Here is the code to solve the given pattern .
public class Pattern {
public static void main(String[] args) {
for (int i = 0; i <9; i++) {
for (int j = 0; j < 5; j++) {
if( j-i<=-4 || i+j<=4) //
{
System.out.print("*");
}
else
{
System.out.print(" ");
}
}
System.out.println();
}
}
}