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

What are classes in javascript?

693


What will happen if an infinite while loop is run in Javascript?

711


What is the difference between registerclientscriptblock and registerstartupscript?

695


If you need to hide the javascript code from the older browser versions, how will you perform it?

762


How can we detect os of the client machine using javascript?

738


What is use strict in javascript?

700


Can you use javascript to hack?

643


What does 3 dots mean in javascript?

678


What is spread operator?

685


Define closure.

695


wap to accept an int array frm the user and print the lucky nos.

1808


How to achieve inheritance in javascript?

728


What are the basic groups of dataypes in JavaScript?

735


What are the decodeURI() and encodeURI()?

790


How to use "join()" to create a string from an array using javascript?

693