Myth - JavaScript and Java Language are the same

December 2016




Myth


JavaScript and Java are thought to be same language or that JavaScript is believed to be some kind of lighter version of Java.

Reality


Java and JavaScript are two distinct programming languages, many people tend to be confused when using both terms due to the similarity in the names.

JavaScript is used in the creation of dynamic web pages. It is client side language and is limited to run on a client browser.

JavaScript features
  • Interpreted by client, but it is not compiled .
  • Object-based. Code uses built-in, extensible objects, but no classes or inheritance.
  • Code integrated and embedded in HTML.
  • Variable data types not declared . .
  • Cannot automatically write to hard disk.


Java is a high level object oriented programming language used for software development or server side applications.

Java feautures
  • It is compiled on server before being run on client.
  • Object-oriented. Applets consist of object classes with inheritance.
  • Applets are accessed from HTML pages,but are distinct from these pages
  • Variable data types must be declared




The main difference between these two languages, is that JavaScript must be used within the web browser (it is embedded within the HTML code) and that Java applets are stand alone functions that can work outside your web browser.

Related :

This document entitled « Myth - JavaScript and Java Language are the same » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.