Jump to content

What is the difference between Java and JavaScript?

piggykid1

Isnt javascript the code language used to code things for java.

cpu: intel i5 4670k @ 4.5ghz Ram: G skill ares 2x4gb 2166mhz cl10 Gpu: GTX 680 liquid cooled cpu cooler: Raijintek ereboss Mobo: gigabyte z87x ud5h psu: cm gx650 bronze Case: Zalman Z9 plus


Listen if you care.

Cpu: intel i7 4770k @ 4.2ghz Ram: G skill  ripjaws 2x4gb Gpu: nvidia gtx 970 cpu cooler: akasa venom voodoo Mobo: G1.Sniper Z6 Psu: XFX proseries 650w Case: Zalman H1

Link to comment
Share on other sites

Link to post
Share on other sites

I'm going to guess. Java is for games and JavaScript is for websites.

Engines like Unity use Javascript for game creation and as far as it's shown me C# and Javascript are very similar when creating games and are easily translatable between the two.

Link to comment
Share on other sites

Link to post
Share on other sites

The difference is you dont usually make a standalone application in javascript. It's more of a language used for scripting events and features(often in web browsers for websites) and is a totally different language to java which is mostly for standalone desktop-type applications but they can be embedded.

 

If you just look on the wikipedia pages for java and javascript you'll see the difference.

Aragorn (WS): 250D | 6800k | 840 Pro 512GB | Intel 530 480GB  | Asus X99-M WS | 64GB DDR4 | Corsair HX720i | GTX 1070 | Corsair H115i | Philips BDM4350UC 43" 3840x2160 IPS

Gimli (server):  Node 304 | G4560 | ADATA XPG SX8000 128GB | 2x 5TB WD Red | ASROCK H270M-ITX/AC  | 8GB DDR4 | Seasonic 400FL

 Omega (server):                 Fractal Arc Mini R2 | i3 4130 | 500GB Maxtor | 2TB WD Red : Raid 1 | 3TB Seagate Barracuda | 16GB RAM | Seasonic G-450w
Alpha (WS): 900D | 4770k | GTX 780  | 840 Pro 512GB  | GA-Z87X-OC | Corsair RM 850 | 24GB 2400mhz | Samsung S27B970D 2560x1440

                              ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Link to comment
Share on other sites

Link to post
Share on other sites

They are Object Oriented Programming languages.

 

They are totally different otherwise.

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

a better question would be

"what are the similarities between java and javascript"

 

the answer would be

- the name

- the somehow c-like basic syntax

 

the rest is very, very different

very different languages for very different purposes

javascript isn't even a programming language, it's just a scripting language

Link to comment
Share on other sites

Link to post
Share on other sites

Java is far more superior then JavaScript.

Java gives you direct access to the system itself where as JavaScript is used to handle browser elements and not the system.

 

JavaScript was originally build by Netscape and completely separate from Java.

JavaScript is specifically build to manage html elements where as java is build to build a platform out of itself like it's own app. 

 

Java is an OOP (Object Oriented Programming) LANGUAGE where as JavaScript is an OOP SCRIPTING Language (Hence the Script in JavaSCRIPT)

JavaScript can only be run from within browsers where as Java is run within a Virtual Machine.

For Java to be understood by the computer it requires it to be compiled before running it where as JavaScript can be run without compiling in before hand

(in fact you can run JavaScript commands pretty much in realtime [try it by hitting F12 on your keyboard and go to the console, type this in alert("this is javascript")

Link to comment
Share on other sites

Link to post
Share on other sites

Java is far more superior then JavaScript.

Java gives you direct access to the system itself where as JavaScript is used to handle browser elements and not the system.

 

JavaScript was originally build by Netscape and completely separate from Java.

JavaScript is specifically build to manage html elements where as java is build to build a platform out of itself like it's own app. 

 

Java is an OOP (Object Oriented Programming) LANGUAGE where as JavaScript is an OOP SCRIPTING Language (Hence the Script in JavaSCRIPT)

JavaScript can only be run from within browsers where as Java is run within a Virtual Machine.

For Java to be understood by the computer it requires it to be compiled before running it where as JavaScript can be run without compiling in before hand

(in fact you can run JavaScript commands pretty much in realtime [try it by hitting F12 on your keyboard and go to the console, type this in alert("this is javascript")

hmmm i'll comment some things

 

javascript is OOP, but pretty poorly, its OOP-ness is very weak, it feels more like a bunch of hacks thrown there just to give you the advantages of OOP

javascript can be ran outside of the browser too, for example in windows. but i have no idea about why would you do that, or how it actually works

javascript is actually compiled in many implementations that you find in modern browsers, for instance jagermonkey in firefox compiles it, making it stupidly fast

java is kinda interpreted, i never really understood the various scenarious, but sometimes it's more interpreted than compiled

Link to comment
Share on other sites

Link to post
Share on other sites

java is kinda interpreted, i never really understood the various scenarious, but sometimes it's more interpreted than compiled

It's never really "interpreted", it uses just-in-time compilation. When you compile a .java file it compiles it into JVM code then when run the virtual machine uses JIT compilation to essentially translate that JVM code into machine code that the computer is able to run.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

It's never really "interpreted", it uses just-in-time compilation. When you compile a .java file it compiles it into JVM code then when run the virtual machine uses JIT compilation to essentially translate that JVM code into machine code that the computer is able to run.

eh not always

i think it depends on the JVM you're using

in sone cases the bytecode is even recompiled for the host machine

some processors have the bytecode instructions in their instruction set, so they just run it natively

but yeah it was just a punctuation about the shady stuff that could happen, it almost always work like you said, in that two step compile-JITinterpret way

Link to comment
Share on other sites

Link to post
Share on other sites

hmmm i'll comment some things

 

javascript is OOP, but pretty poorly, its OOP-ness is very weak, it feels more like a bunch of hacks thrown there just to give you the advantages of OOP

javascript can be ran outside of the browser too, for example in windows. but i have no idea about why would you do that, or how it actually works

javascript is actually compiled in many implementations that you find in modern browsers, for instance jagermonkey in firefox compiles it, making it stupidly fast

java is kinda interpreted, i never really understood the various scenarious, but sometimes it's more interpreted than compiled

"JavaScript can be run without compiling in before hand" By this I mean you don't need to worry about about compiling the source by yourself to be able to use it.

In JavaScript you're as much capable of creating object as in java, you don't have to specify the type of objects but this does not mean that it's not object oriented.

I do agree I phrased that incorrectly by stating that JavaScript can only be run within browsers, by this I actually meant that it mainly is used within browsers and unlike java it has less access to the system.

Link to comment
Share on other sites

Link to post
Share on other sites

"JavaScript can be run without compiling in before hand" By this I mean you don't need to worry about about compiling the source by yourself to be able to use it.

In JavaScript you're as much capable of creating object as in java, you don't have to specify the type of objects but this does not mean that it's not object oriented.

I do agree I phrased that incorrectly by stating that JavaScript can only be run within browsers, by this I actually meant that it mainly is used within browsers and unlike java it has less access to the system.

being able to create objects is not enough to call a language object oriented, i was talking about all the mechanics that are involved in OOP such as inheritance

i agree with you on the rest

Link to comment
Share on other sites

Link to post
Share on other sites

They're completely different programming languages, and as far as programming languages go, they're very, very different.

 

Java is a compiled strongly typed object-oriented programming language that runs inside the JVM (Java Virtual Machine). It is primarily used in enterprise development and, more recently, for Android development.

 

JavaScript is a dynamic late binding scripting language. It is primarily used for client side web programming - i.e. in the web browser. In fact, JavaScript is now an essential part of the latest web programming standard HTML 5, along with CSS and HTML. You cannot have HTML 5 without JavaScript. Its use is spreading to more and more places, and it can now be used for mobile programming (e.g. PhoneGap) and server-side programming (e.g. node.js).

Link to comment
Share on other sites

Link to post
Share on other sites

being able to create objects is not enough to call a language object oriented, i was talking about all the mechanics that are involved in OOP such as inheritance

i agree with you on the rest

Just like in Java you are able to create instances of classes and allow them to interact with each other. What defines OOP is the fact that you're able to create instances of classes and use them to interact with each other.

This is an article which I read a while ago when I got into JS and should explain how it is OO.

Link to comment
Share on other sites

Link to post
Share on other sites

What is the difference between Java and JavaScript?

 

 

JavaScript is a duck-typed scripting language developed for the web, it is usually run time-parsed and not pre compiled. the pirmary place you will find javascript is in conjuntion with HTML on WebSites and Web Apps. Unity does have a JavaScript parser but this is slightly different. and JavaScript has also been adapted to work on a server with node.js.

 

Java is a strictly typed language which is pre-compiled into byte code(eg when you deploy an application you do not deploy the source code but a machine-friendly version of the code) its more used for server side / business workflow programming and can be used for desktop development(such as games). this is more comparable to languages like c++ and c# (although the actual comparisons are much more complicated).

Link to comment
Share on other sites

Link to post
Share on other sites

Java and Javascript have nothing to do with each other apart from similar names.

Javascript is an implementation of the ECMAScript standard (as are JScript and ActionScript), and it was named Javascript (I believe) simply because Java was the hot new thing at the time.

Link to comment
Share on other sites

Link to post
Share on other sites

JavaScript: As the name says "Script programming language", so no compiling
Java: is OOP language, objects and classes and that stuff :D

JS is for client side web scripting
Java multiplatform programing, stuff like normal apps but easy way to port them to, TV, PC, MAC, smartphone...etc

so as @LukeTim said,  "Java and Javascript have nothing to do with each other apart from similar names."

Link to comment
Share on other sites

Link to post
Share on other sites

Why do people make topics like this that ask basic questions?  You can Google your question and probably find it yourselves. 

 

http://lmgtfy.com/?q=What+is+the+difference+between+Java+and+Javascript%3F

 

See how easy that is?

That's like asking why do people ask questions...

People ask "basic" questions here because this is a place and there are people here who may be able to answer the question. It may well surprise you that some people prefer to ask others and not use google... especially if they don't fully understand the topic enough to know what keywords to use in a search.

Seriously, this is a really petty thing to complain about. If you think the question isn't worth your time, don't bother responding to it.

Link to comment
Share on other sites

Link to post
Share on other sites

That's like asking why do people ask questions...

People ask "basic" questions here because this is a place and there are people here who may be able to answer the question. It may well surprise you that some people prefer to ask others and not use google... especially if they don't fully understand the topic enough to know what keywords to use in a search.

Seriously, this is a really petty thing to complain about. If you think the question isn't worth your time, don't bother responding to it.

 

I guess you and I differ on what a stupid question is. 

 

If you are wondering what the answer to your question is, you should probably try typing it into a search engine or two and see what the internet spits out.  Why?  Other people all over the world have probably asked the same question at one point or another.  It takes such small effort on your part to just do that simple step. 

 

You want to know why I get a bit frustrated when I see people make topics like this?  It's because you're not contributing to deeper conversations and understandings when you make topics like this.  Some of us come on here to get thoughts/ideas/collaboration related to programming/software design.  Have a programming problem you're a bit stuck on?  Ask for some help.  Want a better explanation of what a function is?  Ask.  However, if you're wondering what the difference between Java and Javascript is,common sense should first point you towards searching for your answer on the internet.  If you looked at some definitions and still don't quite understand, then you go ahead and ask. 

 

Excuse me for wanting others to try and find the answers to their questions themselves before asking for help.  Asking for help is not a bad thing, but if that's all you know how to do then what are you going to do when there is no one there to answer your questions?

Link to comment
Share on other sites

Link to post
Share on other sites

I guess you and I differ on what a stupid question is. 

 

If you are wondering what the answer to your question is, you should probably try typing it into a search engine or two and see what the internet spits out.  Why?  Other people all over the world have probably asked the same question at one point or another.  It takes such small effort on your part to just do that simple step. 

 

You want to know why I get a bit frustrated when I see people make topics like this?  It's because you're not contributing to deeper conversations and understandings when you make topics like this.  Some of us come on here to get thoughts/ideas/collaboration related to programming/software design.  Have a programming problem you're a bit stuck on?  Ask for some help.  Want a better explanation of what a function is?  Ask.  However, if you're wondering what the difference between Java and Javascript is,common sense should first point you towards searching for your answer on the internet.  If you looked at some definitions and still don't quite understand, then you go ahead and ask. 

 

Excuse me for wanting others to try and find the answers to their questions themselves before asking for help.  Asking for help is not a bad thing, but if that's all you know how to do then what are you going to do when there is no one there to answer your questions?

How is asking google any more "find(ing) answers to their questions themselves" than asking people on a forum? You're still asking something a question... I don't see how it makes a difference whether it's a person or a machine. The mere fact that the OP chose to ask this question here suggests to me simply that they respect the members of this forum's knowledge and understanding and so felt a preference to hear our opinions on it rather than some nameless, faceless person found by google who may or may not even be correct.

This may not be a useful topic of discussion to you but this forum isn't designed entirely to cater to your preferences. What you may see as asinine and inane other people might find interesting or stimulating. Not everyone is at the same level of experience here, and we all deserve to be able to have discussions in peace and not be harrassed and complained about because of supposed "laziness" and "stupidity" apparently perceived purely out of ignorance and contempt for those without experience.

Link to comment
Share on other sites

Link to post
Share on other sites

They're completely different programming languages, and as far as programming languages go, they're very, very different.

 

Java is a compiled strongly typed object-oriented programming language that runs inside the JVM (Java Virtual Machine). It is primarily used in enterprise development and, more recently, for Android development.

 

JavaScript is a dynamic late binding scripting language. It is primarily used for client side web programming - i.e. in the web browser. In fact, JavaScript is now an essential part of the latest web programming standard HTML 5, along with CSS and HTML. You cannot have HTML 5 without JavaScript. Its use is spreading to more and more places, and it can now be used for mobile programming (e.g. PhoneGap) and server-side programming (e.g. node.js).

 

anyone who agrees with this is right.

 

to address the name issue:

 

everytime you see javascript, just read 'ECMAscript' instead.

 

javascript is just a marketing name because java was VERY popular when js was released and wanted to be taken seriously.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×