Bel-Technology interview question

Java pattern for stars print