“To be or not to be…” Is the beginning of a monologue by which Shakesperean character?

Question: “To be or not to be…” Is the beginning of a monologue by which Shakesperean character?

Choices:

Romeo
Lady Macbeth
Hamlet
King Lear

Correct answer:

Hamlet