Javascript Vs. Java: What's the Difference?
Tags: javascript, java
Published: 2022-09-24 20:20:46

##Introduction
Many people who begin to code start off with learning javascript and an early lesson consists of one simple statement: 'Javascript is not Java'. For most people learning that's all that will be heard, but what exactly is Java? How does it relate to javascript? How is it different from javascript? Well, here's a quick answer.

##What is Javascript and Java?
To establish the difference between javascript and Java, it is required to know what they are.

###What is Javascript?
Javascript is simply a programming language that was created and is still used for the production of dynamic webpages, although it is used for more than just websites. It often has to rely on dependencies in order to interact with networks and storage (ie: servers and databases).

###What is Java?
Java, as stated by their owner Oracle, "is a programming language and computing platform", which, to explain in layman terms, is both the code and the mechanism to run said code. It is an object oriented language capable of compiling its code and running on any platform, the basis of this serves as part of Java's slogan "write once, run anywhere". Java's inbuilt runner is known as the Java Virtual Machine.

##How are Java and Javascript Related?
In terms of relationship there is actually no link between Java and javascript other than the two having similar names and the fact javascript is a trademark name by Oracle. Java was created by Sun Microsystems before the company was bought out by Oracle, while javascript was created by Netscape through developer Brendan Eich (who later acted as one of Mozilla's founders). However, since javascript is run on different engines ownership tends to depend on who created the engine an individual decides to use.

##What are the Differences?
There are a large number of differences between Java and javascript, but some notable differences include:

- Java apps run on any virtual machine/browser while javascript only runs on browsers or servers with the help of node.js.
- Java objects use classes while javascript objects use prototypes.
- Java files end in `.java` while javascript files end in `.js`.
- Java requires the Java Development Kit to run while javascript can run on any text editor or browser.
- Java is a back-end language while javascript is both a front-end and back-end language.

##Closing
Java and javascript are very different programming languages despite having very similar names. Java is an independent language and machine while javascript relies on many other systems in order to be utilized. Each have their own advantages and disadvantages that sets them apart.

##Helpful Links/Information Sources
[Differences Between Java and JavaScript - GeeksforGeeks](https://www.geeksforgeeks.org/difference-between-java-and-javascript/)
[Java](https://www.java.com/en/)
[Java - Wikipedia](https://en.wikipedia.org/wiki/Java_(programming_language))
[JavaScript - Wikipedia](https://en.wikipedia.org/wiki/JavaScript)
[What is Java and why do I need it? Java website](https://www.java.com/en/download/help/whatis_java.html)
[Who Owns JavaScript?](https://iq.opengenus.org/who-owns-javascript/)
[Write Once, Run Anywhere](https://en.wikipedia.org/wiki/Write_once,_run_anywhere)