You see, HTML isn't really a programming language, it's what's known as a “markup” language, which is really just used to describe how to present text in your browsers.
This means you'll be able to use fun things like control structures, data structures, data validation, even an in-browser database if you feel the need to get fancy!
Although they share the same root word, these two programming languages are quite different in the way they work under the hood.
Compare and contrast this “client-side” idea to the Java language. Java is a “server-side” language. This is the case because when one of your users interacts with a web application that's powered by Java, the user won't ever see your Java code. The Java code exists on YOUR web server (either in your house or in some hosting companies data-center), never on the users' computers.
This client-side vs server-side distinction is just the start of many important differences between the two programming languages.
This is a great question!
The answer will depend on the project you're working on. You see, Java is typically chosen as the “go-to” programming language when you want to build “enterprise” level applications. What this means is that if you're wanting to build an application that will be used for business purposes and will be a fairly large application with hundreds or thousands (or millions) of users, then Java is probably your language of choice.