You can uninstall Java on Windows 10 in the same way as any other application.
Open Start – Settings and search for “Apps & features“:
Search for “Java” in “Apps & features” and press “Uninstall” on Java (64-bit):
Do the same is for Java(TM) SE Development Kit:
Removing Java is in progress:
And Java successfully removed from your PC.
If you want to remove Java from registry Oracle recommends to use Microsoft utility.