Difference between Java and JavaScript 

 

Java

Java is strongly typed language and variable must be declare first to use in program.In Java the type of a variable is checked at compile-time. Java is an object oriented programming language. Java applications can run in any virtual machine(JVM) or browser. Objects of Java are class based even we can’t make any program in java without creating a class. Java program has file extension “.Java” and translates source code into bytecodes which is executed by JVM(Java Virtual Machine). Java is a Standalone language. Java program uses more memory. Java has a thread based approach to concurrency

JavaScript

JavaScript is weakly typed language and have more relaxed syntax and rules. JavaScript is an object based scripting language. JavaScript code used to run only in browser, but now it can run on server via Node.js. JavaScript Objects are prototype based. JavaScript file has file extension “.js” and it is interpreted but not compiled,every browser has the Javascript interpreter to execute JS code. contained within a web page and integrates with its HTML content. JavaScript requires less memory therefore it is used in web pages.