Apparently, fans weren't the only ones who were shocked to learn that Walden and Alan will get married when "Two and a Half Men" returns to CBS for its 12th and last season next month.

"Two and a Half Men" star Jon Cryer himself admitted that he was stunned when he discovered that his character Alan would get hitched with Walden.

"The first time I heard it I said, WHAT?!" he told E! News back in July. "And then I thought, 'Oh yeah it kind of makes sense, because last season Alan's wedding fell apart and Ashton's wedding has fallen apart. The writers have a good idea and it opens up a lot of doors. Two heterosexual guys who are getting married because they want to have a kid together. OK. Why not? You know, I'm sure it's gonna happen. I can't imagine that kind of thing won't be happening in real life at some point."

Earlier this summer, CBS Entertainment President Nina Tassler revealed that Walden and Alan will agree to adopt a child after Walden suffers from a health scare that causes him to re-evaluate his life. However, in order to do so, the heterosexual roommates will first have to get married since its easier for married couples to adopt.

Tassler dropped other spoilers about the same-sex wedding next season, telling The Wrap that "Walden has a near-death experience" which "forces him into sort of this existential quandary and to evaluate the meaning of his life, the quality of his life, which prompts him to say, 'I need to put down deeper roots.' And he wants to adopt a child."

Tassler went on to explain that Walden, who is single, believes it will be easier for him to adopt if he were married.

"He wants to adopt a child and it is particularly challenging to do so as a single male. So he decides that he and Alan should get married, and they will adopt a child as a gay couple," she teased during the Television Critics Association summer press tour in July, according to ABC News.

Jim Patterson, the head writer and executive producer who came up with the idea, explained why he felt it was important for the straight roommates to get married.

"This is our last year. So we wanted to center the last year on Alan and Walden and have those guys do an adventure together the whole season because they're so great together."

Season 12 of "Two and a Half Men" premieres on CBS on Oct. 30.