Programatically changing template of a page

Is there a way to change the Template of a page from Default Template to another programatically?

Solutions Collecting From Web of "Programatically changing template of a page"