Yep! If you owned either one before June 7th 2022, you got the other one automatically given to you. And if you didn't own either of them before that date and you buy from the official website you get both Java Edition and Bedrock Edition.
I haven't played Minecraft since they got bought out by Microsoft. So I have no idea what's happening with it these days. I remember my friend recommended the game to me and I missed out on paying $5 for the Alpha version by like a week and got the Beta version for $10, I think (or maybe it was 10 and 15).