Depends on which version your friends have. There are a lot of differences, mostly technical, but to sum it up, if you want to play on java servers and/or use mods, buy java, and if you want endless monetization on packs, add-ons, maps and skins, get Bedrock edition (the one in the Microsoft store).