Both have pros and cons.
Bedrock Edition has better performance and cross-compatibility. It also has the ability to allow friends to join your world without setting up a server. However, these servers are very limited. Bedrock Edition is also mostly pay-to-win for almost ALL skins, maps, resource packs, and add-ons.
Java Edition servers are less user friendly, but they allow an infinite amount of people to join (if your computer can handle it). Java may not have cross compatibility, but if you got it before a certain time, it lets you get Bedrock Edition on Windows 10 for free. Almost all Java skins, maps, datapacks, mods, servers, and plugins are free, with the only exception being ones where the creator makes you purchase it to download the file (these aren't very secure and people tend to republish them after one person buys it anyway).
Also, Bedrock Edition isn't fully updated. It lacks the amazing command system of Java Edition. It also is missing a lot of sound files. The game just feels slower in general, even if there is actually less lag. It takes longer to do things and sounds are disproportionate. It also has less settings, especially for sounds.