Foreshadowing is a dramatic device in which an important plot point is mentioned earlier in the story to return later in a sinificant way. This is said by Hermione Granger in A Very Potter Musical.
Snape: A person can however be a horcrux.
Harry: What's a horcrux?
Snape: I'm no even going to tell you Harry, you'll find out soon enough.
You find out later, Snape knew there were horcruxes concerning Harry. This exemplifies foreshadowing.
Mentioning a gun at the beginning of the story and not shooting the gun until the stroy's end is not foreshadowing, it's fucking procrastination.
Taken from Unforgotten Realms episode 4,
"Foreshadowing is when a character is covered by a parabola."
If rob = x
then y = pwn
*Ninja turtles NES game music intro*.
Mike: "What the hell was that?"
Rob: "It's called foreshadowing hool who is filled with dick!"