No, Minecraft redeem codes are usually specific to either the Java or Bedrock edition. Make sure you are using a code intended for the edition you are playing.