Java is known for working on different operating systems (Windows, Mac, Linux…). It is also the primary language for Android apps. Some websites are also written using it. We have created stand-alone applications along and applets. If you need an application that runs on Windows, Mac and Linux, using Java is a good way to do it.
Applets could be placed inside a web page and would be run by the visitor’s browser. Current browsers make it hard or impossible to run applets on a website. Most of what was done using Java applets is now done by JavaScript.
JavaScript and Java are considered two different language although they are both C based. JavaScript is meant to run inside web browsers and Java is meant for applications and on web servers.