
When we call Java or JavaScript. Our first question in our mind comes that these are the names of the same language. Or these are the languages which relate to each. But you are wrong. Both languages are different and the writing syntax and coding standards are different to each other.
They are totally opposite in use and also in working and compiling perspective as well.
What is the main difference between java and JavaScript?
According to me the main differences in both these languages is that:
- JavaScript is a scripting language while Java is a pure Object Oriented Programming Language.
- JavaScript is used to develop web applications only and is used on client side computers and runs on web browsers. While Java programming language is a server side programming language and is used in many platforms like android apps, web apps, desktop apps and in networking also.
- JavaScript programming language is text-based and compiled by the web browser. While Java programming language is first compiled into binary code and via virtual machine this code is then run on any platform and can be compiled by virtual machine according to the platform specifics. This virtual machine is called Java Development Kit (JDK).
- JavaScript is not a pure object oriented programming language but it has predefined objects and functions. While Java is a pure object oriented programming language which cannot be written without creating any class even if you have to write a “Hello World” program. You need to write a class for it and then create an object and call it by main function.
- With JavaScript you can create animations and can manipulate web documents. While with Java language you can write business logic and can develop many complex server side applications.
Basically when the name of JavaScript was decided those days the Java language was very popular in the market and that’s why the creator of JavaScript decided to name it JavaScript. So that people could attract this language to use it.