Explain and exemplify UTF-8, UTF-16, and UTF-32: Provide a detailed explanation of what are UTF-8, UTF-16, and UTF-32. Also, include several snippets of code to show how these work in Java.