Diff between java and javascript

I just started learning javascript and then i noticed there is a topic called java. there are two courses on codecademy one is java and one is javascript. what is the difference between them? or are they the same?


They’re entirely different languages! Javascript is as the name implies, a scripting language. It works in the web browser and doesn’t require compiling to use i.e. the browser just directly uses and execute the Javascript code that has been written. This allows it more simplicity and flexibility.

However Java requires to be compiled, and almost every bit of code written must be contained within a class to operate. It’s a lot more verbose and slightly harder to learn than Javascript, but once it’s compiled it can be run essentially anywhere that has Java installed, including for standalone applications. For example Minecraft has it’s Java edition, which is the original edition built entirely in Java to make the whole thing run.

The naming can confuse people a lot, as Javascript sounds like it’s maybe a follow-up or just another name, but they’re entirely different languages which have different requirements and different syntax to learn. I would recommend learning Java as it’s really fun and basically every Android app runs on Java, however it is different to Javascript.


@akshit.ireddy there’s also this video that might be really helpful to watch

1 Like

The code in the languages are different, but I too thought they were the same when I heard of them.

Thank you for sharing the video.

1 Like