What could the man say to make the judge contradict himself?
He said, "You'll sentence me to ten years in prison." If it was true, then the judge would have to make it false by sentencing him to four years. If it was false, then he would have to give him ten years, which would make it true. Rather than contradict his own word, the judge set the man free.