public Demo2(Demo2 d)//It is copy constructor --pass class type object { name = d.name; loc = d.loc; }