Cognizant interview question

Draw certain pattern in java, oops concept