CloudKaptan Interview Question

JAVA basics , OOOPS Coding question from array and star pattern