When a JavaScript engineer (experienced JavaScript) decides to do Java for some reason, I keep a memorandum of problems, precautions, and difficulties that I encountered. As a basic stance, the difference between JavaScript and Java is described from the JavaScript side.
First of all, the threshold is different. For JavaScript (hereinafter abbreviated as JS), all you need is a browser and a notepad (editor). Both are standard equipment, and if you just want to try JS, you can just hit it on the console of the browser, so you don't even need Notepad. This is because, after all, JS is originally an interpreter-type scripting language that has a processing system in the browser because it wants to add actions to HTML.
Java, on the other hand, is a compiler-based programming language and cannot be run with standard equipment alone. Since it runs on the JVM, insert the JRE / JDK. You can find as many ways to put it on the net. As a point of caution, is it about "passing through the path"?
JS is so-called dynamically typed, and there is no exact type. Sometimes it's easier because there's no mold, but sometimes it's a pitfall. Declare all primitives and references with var.
Java, on the other hand, is statically typed and strict. This is the first point I'm not used to, and I have a hard time.
There are about 8 types in total related to boolean, char, and other numbers. The first letter of the model name is all lowercase!
Strings, arrays, etc. The first letter of the model name is uppercase! There seems to be a rule in Java that the first letter of the class name is capitalized.
Recommended Posts