Java Language vs. JavaScript

I’m learning a little about Java. Anyone with some Java knowledge, what do you think of it as a language and in comparison/contrast to JavaScript?

I personally like it better simply because it is OOP. I miss writing classes and inheritance in javascript.

Java is OOP taken to the extreme, and you’ll definitely the miss the versatility a language like C++, Python or JS offer regarding that.

Despite my personal dislike for it, it’s still pretty important because a ton of big enterprise software plus Android use it, so it’s definitely worth learning.

I don’t want to repeat the answer again. I 'd suggest to look for answers to similar questions at stackoverflow.com.

http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java

Keep coding!
Marcin

Differences:

Java is a statically typed language while JavaScript is dynamic.
Java is an OOP programming language while Java Script is an OOP scripting language.
Java is class-based; JavaScript is prototype-based.
Java runs in a virtual machine or browser while JavaScript runs solely in a browser
Java code needs to be compiled while JavaScript code are all in text. They require different plug-ins.
Java constructors are special functions that can only be called at object creation; JavaScript "constructors" are just standard functions.
Java requires all non-block statements to end with a semicolon; JavaScript inserts semicolons at the ends of certain lines.
Java uses block-based scoping; JavaScript uses function-based scoping.
Java has an implicit "this" scope for non-static methods, and implicit class scope; JavaScript has implicit global scope.

More about,java and javascript

Lee

Java is the first programming language I learned. As a part of a project I am developing Android app(Java) , server (JS) and admin panel in react(JS) .
I strongly prefer Javascript. For example, I wanted to get data from the server on my android app and I had to use another service - retrofit. In addition I had to parse the json Data I retrieve and save it as an object.
All I had to do with react was to use fetch() and learn a little bit about promises which I find extremely useful.

2 Likes

Also use this for comparison: http://christianrubiales.com/hyperpoly/?q=java,javascript

I just use both Java and JavaScript
If you know Java, it is easy to learn JavaScript
If you know JavaScript, it is easy to learn Java

My fav quote from that SO link:

Java and Javascript are similar like Car and Carpet are similar

:smiley: