Adding to the answers by Lauren Ipsum and CLockeWork.
I'll just look at the second example:
Was it an elephant? No, elephants didn't frequent beaches. It was — a whale!
Was it an elephant? No, elephants didn't frequent beaches. It was ... a whale!
It seems to me that the dash as a sign of a sudden change works well in the narrative, but not in direct speech:
"What happened?"
"I found something on the beach," John replied. "I saw something and at first I thought it was an elephant? But elephants don't frequent beaches. It was — a whale!"
To me, this sounds strange. John is talking as if he were writing a book!, which he is not. He is supposed to be speaking with someone. But this works fine:
"It was ... a whale!"
In direct speech, an ellipsis signifies a pause. A dash in direct speech can only signify an interruption, where the speech breaks off and does not continue.
Only in the narrator's narrative, which follows different stylistic principles, does a dash mean a sudden change. Here it cannot mean a break-off, because the narrative does not break off until the end of the book. Only if the narrative is written as if it was spoken, can a dash in the narrative means a break:
Was it an elephant? No, elephants didn't frequent beaches. It was— What? No. Stop interrupting me, and let me tell my tale. It was a whale!
And an ellipsis has no place in the narrative, in my opinion. What does this mean:
Was it an elephant? No, elephants didn't frequent beaches. It was ... a whale!
Does it mean that the narrator pauses? He cannot, because he is not talking. There are no pauses in writing, or rather, they take a different form, e.g. as full stops, paragraph breaks, and so on. In poetry you might do:
It was. A whale.
or more commonly:
it was
a whale.
In prose you need to use different constructions:
It was, as we found, a whale.
Here, the subsidiary clause, serves as a suspenseful pause.
tl;dr
To sum this up:
(a) ellipsis:
- dialogue: pause
- narrative: — (do not use in fiction)
(b) dash:
- dialogue: break-off
- narrative: sudden change