Apexon interview question

oops concept,simple program, sql query and theory