Write a Program to print following pattern !

Solution :
Here is the Java code print the above pattern.
public class pattern {
public static void main(String[] args) {
for (int i = 0; i <5; i++) {
for (int j = 0; j < 5; j++) {
if(i+j <= 4)
{
System.out.print("*");
}
}
System.out.println();
}
}
}