Not researching your upcoming surgery and asking your doctor questions can backfire in terms of nasty surprises and then some arising from false assumptions. Even I had a few unexpected things pop up. This is not a surgery to take lightly. It's something that *WILL* change your life to a degree and the road to recovery will take a LOT of work.
Robin's Total Knee Replacement site was the first I visited. She underwent two total knee replacements (TKR). It's got links for TKR and hip replacements sites. Her knee's inability to straighten out at first mirrors me at the moment, as seen in her TKR entry updated July 1998. Exercise and walking can help in straightening it out more, including swimming.
Marie wrote Is a Total Knee Replacement Worth It? Her experiences nearly mirror mine. It was worth it despite being in a rehab facility for 3 weeks. I went from bedbound to using a walker.
While beds in hospitals and some at nursing homes and rehab facilities are adjustable in height, your own bed may not be. It may help to keep something nearby to get up onto it if it's higher than normal.