In the context of the prologue given by the Chorus at the beginning of William Shakespeare's romantic tragedy Romeo and Juliet, the entirety of the play is an example of dramatic irony in that the audience knows the fate of the characters but the characters do not. As the play progresses, the characters live out their individual and collective destinies based solely on the information that they have at any particular moment in the play.
The dramatic irony of Romeo and Juliet contributes to the conflicts in the play and helps to create humor, dramatic tension, and also suspense, because, even though the audience already knows the outcome of the play, the audience doesn't know how each character will react to each situation in the play that will ultimately lead them to that outcome.
Examples of dramatic irony occur within the overall context of Romeo and Juliet as well. In the prologue to act 2, the Chorus tells the audience that although Romeo and Juliet will encounter difficulties, they'll overcome those "extremities."
CHORUS. But passion lends them power, time means, to meet,
Temp'ring extremities with extreme sweet. (Pro. 2, 13-14)
In act 2, scene 1, on their way home from the Capulets' feast, Mercutio and Benvolio make jokes about Romeo being lovesick for Rosaline. The humor of the scene is derived from the fact that Mercutio and Benvolio are unaware that Romeo is no longer lovesick for Rosaline, but the audience knows that Romeo has fallen in love with Juliet—and at the same party that Mercutio and Benvolio just attended.
In the next scene, Romeo has already jumped the wall into the Capulets' orchard, and he's hiding in the trees when Juliet appears at a balcony window. Juliet thinks she's alone, unaware that Romeo is just a few feet away from her, when she calls out to him that famous line, "O Romeo, Romeo! wherefore art thou Romeo?" (2.2.35).
Their ensuing romantic scene together is tempered by the audience's knowledge that this meeting will lead to their deaths.
After Romeo and Juliet agree to get married, Romeo hurries to Friar Laurence. In act 2, scene 3, Friar Laurence suggests that Romeo "hast not been in bed to-night" (2.3.43), which is true, but the Friar assumes that Romeo was with Rosaline. Romeo tells the Friar that he's now in love with Juliet, which comes as a surprise to the Friar, particularly when Romeo asks the Friar to marry them that same day.
Friar Laurence agrees to marry them, believing that “this alliance may so happy prove / to turn your households’ rancor to pure love" (2.3.94–95). The situational irony for the characters—the Friar's hope that the marriage of Romeo and Juliet will end the feud between the families actually results in an escalation of the feud, to the detriment of both families—is dramatic irony for the audience. The audience already knows that the relationship between Romeo and Juliet isn't going to end well.
In act 2, scene 4, Mercutio and Benvolio continue to make jokes at Romeo's expense about his love for "that same hard-hearted wench, / that Rosaline" (2.4.4–5), still unaware that Romeo is no longer lovesick for her but is planning to marry Juliet. Mercutio mocks Romeo with a list of tragic heroines from ill-fated love stories, not realizing—although the audience does—that the names of Romeo and Juliet will soon be added to that list.
Juliet's Nurse appears in the scene, and Romeo tells her that he's arranged for Friar Laurence to marry them this afternoon, which, as the audience knows, will seal Romeo and Juliet's fate.