Foreshadowing is a literary device in which "hints" are given by the author to suggest possible future plot developments, or truths about these events.
By giving insight into an event, or giving the reader the 'feeling' of having insight, a writer can direct the attention of the reader. Well placed, subtle pointers can work to enhance the theme of a novel, short story, or play.

Foreshadowing can be direct or subtle, and can either be symbolic of a fundamental truth, or be such a widespread phenomenon that one is lead astray to a completely different conclusion.

Here are some visual examples... which do you think represents explicit foreshadowing? implicit foreshadowing? symbolic foreshadowing?

(they are in that order)

Many of the implied or "symbolic" tools of foreshadowing don't become apparent to us when we first first read through the book: It is only once we've grown knowledgeable of the events of the book that 'symbols' in the previous sections become clear to us.

In Flannery O’Connor’s short story A Good Man Is Hard to Find, the antagonist is discussed by characters before his appearance. The characters depict him as an unlikely, but dangerous threat. The characters are SO sure they would never encounter this embodiment of all eveil, and so foreshadow just the opposite. This kind of foreshadowing is on a more literal level, where context and dialogue give the reader a sense of the outcome before its occurrence.

A second example lies in Wide Sargasso Sea by Jean Rhys: Antoinette’s death is foreshadowed by the death of her bird Coco. Here we see symbolism at its finest: Coco dies because the bird is unable to fly away from the fire set by the locals; this is similar to the cage that society and the inter-cultural conflicts of the time that encloses Antoinette, and the escape she finds in death by jumping off a balcony (after setting her home ablaze). This is an example of symbolic foreshadowing, in which the foreshadowing element is only apparent after the foreshadowed event has occurred.

In Kate Chopin’s The Awakening, Edna’s first venture out into the ocean elicits powerful emotions of freedom and pride followed by a momentary “vision of death”. This combination of emotions returns in the ending of the novel in a more extreme form, when Edna swims into the ocean once more for a final, emancipating death.

Foreshadowing in Albert Camus' The Stranger is, on the face of things, not a very inherent plot device.
On hinsight, however, we could read into any number of his actions as “foreshadowing” his future conflicts with society.
Meursault’s indifference to his mother’s death would not, however, strike readers as a bad omen pointint to his isolation from society that follows in the second part of the novel: now-a-days distant relationships with ones own family is a fairly wide-spread practice. At the time it was written, however, many more readers would potentially have come to the conclusion that such acts on Meursault's part inevitably lead to his later troubles and were a sure precursor to his anti-social views on life.
His date with Marie so soon after the funeral could strike a wrong chord among some readers, and so could be seen as an implied foreshadowing of the arguments the procecutor brings to light in the course of the trial.

In Gabriel Garcia Marquez’ novel Chronicles of a Death Foretold, the concept of foreshadowing is taken completely out of context, as the net result of the novel, the death of Santiago Nasar, is announced in the opening paragraph of the book.
There are, however, a few examples of direct foreshadowing: Santiago Nasar dreams of trees in the days preceding the wedding, as well as during the early hours of the morning before he is killed. Trees are a bad omen, one that his mother fails to identify as such.
In the Columbian culture dreams are verified ways of divining the future: the mother is a “recognized” interpreter of dreams in the village.
Throughout the novel little hints lead the reader to view Santiago Nasar's death as a 'sacrifice' to the society he lives in. It begins, chronologically, with the string of events that culminate into one huge spectacle in the village square, and ends with Santiago Nasar pinned up against the door of his own house, dressed in white, and bearing knife wounds of two sacrificial butcher knives. The reader is given numerous clues throughout the novel (which is a collection of memoralia from many different inhabitants of the town, and is not told in order of events, but rather a cuddle muddle of the entire episode) such as the sacrificial rites that the townspeople conduct in anticipation of the bishop's visit.

here's the link to the movie