Home Answers Viewqa Java-Interview-Questions What is difference between the java and javascript?

 
 


pradeep
What is difference between the java and javascript?
1 Answer(s)      2 years and 7 months ago
Posted in : Java Interview Questions

What is the difference beteen the java and javascript?

View Answers

October 28, 2010 at 10:44 AM


Hello Friend,

Difference:

1) Java is a Object Oriented programming language developed by Sun Microsystems, while JavaScript is a scripting language that was introduced by Netscape.

2) Java creates applications that run in a virtual machine 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 can only be used as a back-end language within a web environment while Javascript is used for front-end web development.

5) Java follows strong type checking where as Javascript is very flexible in datatype(loosly typed). Ex : Variables in Java: int num;String st; Variables in Javascript: var name;

6) Java support function declarations, with accessibility specifiers,parameter datatype,return type while Javascript does not.

Ex: function declaration in java:
    public int functionName(int no){
    }

    function declaration in javascript:
    function fcnName(str){
     }

Thanks









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.