Capita india interview question

Q. write inheritance code to demonstrate the property