Can this be resolved by rejecting the idea that every statement
must be one of true or false? If the professor's statement that there will be a surprise exam is neither true nor false, but merely not yet decided, then there is no contradiction. Indeed, the professor can't know for sure that his exam will be a surprise, as the students may have guessed, or placed a spy camera in his office, etc. The professor can guarantee that the exam is not a surprise by announcing it, but he can never guarantee that it is a surprise, only make a good attempt.
Similarly, "this sentence is false" is neither true nor false, but just nonsense. "The set of all sets that do not contain themselves" is not a paradox or a contradiction, it simply describes an object that doesn't exist. Likewise, the professor's statement isn't known to be true or false at the time it's made, and either outcome is possible.