What are the main diference between Java and JavaScript?
Printable View
What are the main diference between Java and JavaScript?
Java is a compiled language - it compiles into bytecode which is then interpreted by the web browser. JavaScript is interpreted by the web browser. Since it is interpreted, syntax errors may exist in the script and you won't know about them until the code is executed.
The syntax is quite different. Javascript has no types. In fact it is half way between C and C++.
Just for the record, many people surfing the net, trying to learn easily confuse java and javscript, and many sites give out faulty info. Javascript is in NO WAY affiliated with java, it is not derived from it, nor is it even the same type of language, javascript is object oriented, java is class oriented. The only reason it's called javascript is because java was the big buzz word at the time (still is one) so they figured it was good marketing.