- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Java and JavaScript.
As we know both Java and javascript are the programming languages and used in application development. But there are significant differences between both of the languages which we will discuss below.
The following are the important differences between Java and JavaScript.
Sr. No. | Key | Java | JavaScript |
---|---|---|---|
1 | Language Type | Java is primarily an object-oriented programming language that requires a virtual machine platform for its execution. | JavaScript is a lightweight programming language(“scripting language”) and used to make web pages that do not require such virtual environment for its execution. |
2 | Syntax and semantics | Java is a type of language where compiler reports exception in case syntax does not meet the requirement or we can say type and code semantics get checked at compile time. | On the other hand JavaScript has weakly typed language and has more relaxed syntax and rules. |
3 | Oops Concept | Java is a pure object-oriented programming language. | Javascript on the other hand is an object-based scripting language. |
4 | JVM requirement | Java requires JVM in order to create a virtual environment for its code execution. | On the other hand code of javascript runs on browser only so no such JVM is being required for code execution. |
5 | File extension | One difference between both is the extension of file in which java code is saved is ".java". | While code of javascript get saved in file which has extension of ".js" |
6 | Performance and memory consumption | As we know java requires JVM which makes it to consume more memory and slower in performance of code execution.Each time we need to deploy the code for reflecting the code change in java. | On other hand javascript code get compiled and run on browser only and thus consumes less memory and fast in performance.Each time we not need to deploy the code for reflecting the code change in javascript. |
Advertisements