Hamlet seems to be the only one of Shakespeare's tragic protagonists who possesses and demonstrates a sense of humor. Like the witty characters of the comedies, he likes to play games with language, to parody other characters' verbal styles and from here the comic scenes began.
most obvious comic scene in Hamlet occurs in Act 5, sc. 1 with the "clowns". The exchange between the two men digging Ophelia's grave is very funny. The two exchange riddles and the first clown continues to exchange riddles, as well as word-play, when Hamlet and Horatio come upon them. Then Hamlet asks whose grave it is that the gravedigger is digging. The gravedigger responds that since he's digging the grave, it's his. Hamlet asks is it for a man or a woman, the gravedigger says it's for neither since the one who will lie in it is dead.
There is some humor in Act 2 also, when Hamlet and Polonius exchange words because Hamlet is making fun of Polonius only he doesn't seem to realize it. Also, the exchange between Hamlet and Osric in Act 5,, when Osric delivers to Hamlet the challenge to the fencing match from Laertes is humorous because Osric is so fawning and pretentious that Hamlet makes fun of him .
The classic comic conflict between blocking father and young lovers, which underlies the actions of many Shakespearean comedies,1 informs one strand of the action of Hamlet: the relationship between Polonius, Ophelia and the Prince.
Here one of the comic saying in the play:
Marry I'll teach you. Think yourself a baby
That you have tane these tenders for true pay,
Finally, the comedy of Hamlet add uniqueness to the play on many different levels: the Prince's sharp wit and his puns add to his complexity and convey his intellectual brilliance, enhancing his attractiveness to audiences. On the other hand, the very limitation and unawareness of the comic characters such as Polonius and Osric.