You are invited to Log in or Register a free Frihost Account!


blah bah7
so what is the difference between java and javascript? i dont think there is one but just asking
blah bah7 wrote:
so what is the difference between java and javascript? i dont think there is one but just asking

There IS. Actually there is a HUGE difference. Java can be used to create standalone applications, JavaScript can't. Java is a compiled language, while JavaScript is interpreted. Java is highly typic, JavaScript is slightly.
The differences are countless. The explanation of the name is:
- both of them use similar syntax, and
- both of them was developed by Sun.
And they can communicate with each other, eg. you can use a Java method in JavaScript, or pass values to and from Java and JavaScript in the browser.
Actually Javascript was developed by Netscape. wrote:

The Java- prefix suggests that JavaScript is somehow related to Java, that it is a subset or less capable version of Java. It seems that the name was intentionally selected to create confusion, and from confusion comes misunderstanding. JavaScript is not interpreted Java. Java is interpreted Java. JavaScript is a different language.

JavaScript has a syntactic similarity to Java, much as Java has to C. But it is no more a subset of Java than Java is a subset of C. It is better than Java in the applications that Java (fka Oak) was originally intended for.

JavaScript was not developed at Sun Microsystems, the home of Java. JavaScript was developed at Netscape. It was originally called LiveScript, but that name wasn't confusing enough.

The -Script suffix suggests that it is not a real programming language, that a scripting language is less than a programming language. But it is really a matter of specialization. Compared to C, JavaScript trades performance for expressive power and dynamism.

Not only does Javascript differ from Java, there are no similarities at all! (Well, only the basic syntax). Javascript is more like Lisp or other functional programming languages than it is like Java.

Some other important differences:
- JS doesn't have Class-inheritance, but prototype inheritance.
- JS doesn't have access modifiers like public, private and protected.
- JS doesn't have classes, all class behaviour is done through constructors
- JS has closures, Java does not
- In JS semicolons are optional
{name here}
blah bah7 wrote:
so what is the difference between java and javascript? i dont think there is one but just asking

There are significant, differences between the two:

Javascript is just a client side scripting language. It is meant to enhance web designs. It is interpereted by the browser. Java is a half-blown programming language run by an interpereter independant of the browser somewhere on the client's computer. It is run by a virtual machine independant of the browser, and ergo it is fully independant of your web page. Java cannot be interpereted by the browser, and it is used for things such as connecting IRC channels and other complex tasks not such tasks as making menus in your web design and cursor trailers(it would be very impractical to do so using Java). Java, however, is now substitute for a full blown application, even though it is very similar.
Javascript and Java are two completely different things. I'm pretty sure javascript only put "java" in the name to feed off the branding of the popular Java language. I think that javascript got a huge boost in popularity just based off of name recognition from "java". It was all a marketing and PR tactic that apparently worked.
There are definitely similarities between Java and JavaScript but more than that there are differences. A simple google search with "Java Vs JavaScript" will fetch you what you need to know. find below some of them:
As has been said many times already and doesn't really need repeating, Java and Javascript are two completely different things.

Javascript was in fact developed by Netscape, not Sun, and was originally going to be called LiveScript. The name was changed so as to benefit from the hype about Java. All they actually managed to do was to confuse everyone. Smile
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Others

© 2005-2011 Frihost, forums powered by phpBB.