Cognizant Interview Question

Ine Java they give me to code star pattern...(Triangle shape)