There is no pre-installed Java version in MacOS - Apple stopped bundling it several versions ago.
That's not to say you can't install it yourself, but it's up to you - https://java.com/
If you have multiple versions of Java installed, the standard method of switching versions is by defining the environment variable $JAVA_HOME to point to the version you want to use.
The specifics on how to do that may vary depending on the version of MacOS you're running and your preferred shell. The default shell in recent OS versions is zsh, so adding:
export JAVA_HOME=/usr
to ~/.zshrc would set the default $JAVA_HOME to /usr, but you can point to any other installed version.