How does an actor memorize lines?

All professions have some hurdles and risk factors which is mandatory to achieve it, likewise when it comes to acting profession people may wonder how does actors memorize the whole script? It may sounds like funny and stupid question but…