Though the Ubuntu environments comes with OpenJDK, You have the authority to remove the OpenJDK and Install OracelJDK based on your requirement. Follow the steps below;

Remove OpenJDK,
execute the following command on terminal:
$ sudo apt-get remove openjdk*

Remove OpenJDK along with dependencies,
execute the following command on terminal:
$ sudo apt-get remove --auto-remove openjdk*

Remove OpenJDK and it’s configuration files,
xecute the following command on terminal:
$ sudo apt-get purge openjdk*

Remove OpenJDK along with dependencies and it’s configuration files, execute the following command on terminal:
$ sudo apt-get purge --auto-remove openjdk*

This is how you can uninstall OpenJDK.

Verify the uninstall by executing the following in the terminal
(Restart, if required)
$ java -version

Writer | Vlogger | Techie | Technical Tester (Snr-QAE)

Writer | Vlogger | Techie | Technical Tester (Snr-QAE)