Suraj interview question

SQL and OOPS , Behaviour question