To be, or not to be, that is the question are lines from which of Shakespeare’s famous plays?

To be, or not to be, that is the question are lines from which of Shakespeare’s famous plays?

Explanation

 “To be, or not to be, that is the question” is a line from William Shakespeare's play Hamlet.

It is the first line of a famous soliloquy in Act 3, Scene 1.