What is the difference between java and java script?

Answer Posted / nazrul

1.Java is an OOP programming language while Java Script is
an OOP scripting language.

2.Java creates applications that run in a virtual machine or
browser while JavaScript code is run on a browser only.

3.Java code needs to be compiled while JavaScript code are
all in text



4.Java follows strong type checking where as Javascript is
very flexible in datatype(loosly typed). Supports types
which represents boolean,int,string

o Ex : Variables in Java is declared as datatype
<varname>; --> int num;
o But in Javascript variable declaration will be as var
<varname>; --> var myName;

5.Javascript support function declarations, but without
accessibility specifiers,parameter datatype,return type
• Javascript : function fcnName(str)
{
........function body..........
}
• Java : public int functionName(int no)
{
..........function body.........
}

Is This Answer Correct ?    32 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the role of deferred scripts in javascript?

686


Difference json arrary vs json object ?

721


Explain the for-in loop?

695


Do I need var in javascript?

681


How to detect browser name using JavaScript?

723


What are screen objects?

694


What is eval() in javascript?

720


Why is javascript dangerous?

704


Does javascript support automatic type conversion, if yes give example.

831


What are the advantages of using JavaScript?

767


Should you use var or let?

693


What is the best site to learn javascript?

642


How to manage exception handling in javascript?

725


What is the use of spread operator?

706


Do I need javascript enabled?

696