Capita india Interview Question

Q. write inheritance code to demonstrate the property