1. JavaScript being a prototype-based scripting language helps in running browser based applications.
Java, an OOP programming language, is used for backend developments. Java helps in server programming and standalone applications.
2. An upgrade in JavaScript called as NodeJs is a server side environment to create robust real – time server tools and applications.
Java needs plugins to create different functionalities.
3. JavaScript is the key when you want to create websites.
Java is the key when you want to create desktop/enterprise applications.
4. JavaScript is dynamically typed, interpreted and runs in a browser
Java is statically typed, compiled and runs on its own VM
Example code for Java:
/* HelloWorld.java
*/
public class HelloWorld
{
public static void main(String[] args)
{ System.out.println(“Hello World!”);
}
}
Example code for JavaScript:
(function() {
console.log(” Hello World “)
})();
Fun Fact
Original Names:
“Java was called as OAK”
“JavaSCript was called as MOCHA”