The road from JavaScript to Java

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.

Difference in environment construction

For JavaScript

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.

For Java

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"?

Difference in type

For JavaScript

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.

For Java

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.

Primitive type (basic type, value type)

There are about 8 types in total related to boolean, char, and other numbers. The first letter of the model name is all lowercase!

Reference type (class type)

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

The road from JavaScript to Java
Java SE8 Silver ~ The Road to Pass ~
Changes from Java 8 to Java 11
Sum from Java_1 to 100
Migration from Cobol to JAVA
New features from Java7 to Java8
Connect from Java to PostgreSQL
From Ineffective Java to Effective Java
JavaScript as seen from Java
Input to the Java console
[Java] I want to calculate the difference from the date
How to write Scala from the perspective of Java
[Java] How to extract the file name from the path
Pass the i18n locale to JavaScript
[java8] To understand the Stream API
[JDBC] I tried to access the SQLite3 database from Java.
Difference between Java and JavaScript (how to find the average)
Get to the abbreviations from 5 examples of iterating Java lists
Road to Java SE 11 Silver acquisition
Delegate some Java processing to JavaScript
Introduction to Functional Programming (Java, Javascript)
Java to be involved from today
From Java to VB.NET-Writing Contrast Memo-
Welcome to the Java Library Swamp! !!
java Eclipse How to debug javaScript
[Java] Conversion from array to List
If you want to change the Java development environment from Eclipse
[Android, Java] Method to find the elapsed date from two dates
From fledgling Java (3 years) to Node.js (4 years). And the impression of returning to Java
[Java] How to convert from String to Path type and get the path
[Java] How to use the File class
Investigate the replacement from Docker to Podman.
Java reference to understand in the figure
Introduction to java for the first time # 2
[Java] How to use the hasNext function
Call Java method from JavaScript executed in Java
The road to Web service creation (Part 2)
The road to creating a music game 2
[Java] How to use the HashMap class
[Ruby] From the basics to the inject method
Kick ShellScript on the server from Java
About the procedure for java to work
Convert from java UTC time to JST time
[Java] How to use the toString () method
Hit the Salesforce REST API from Java
Using JavaScript from Java in Rhino 2021 version
Studying how to use the constructor (java)
Connect from Java to MySQL using Eclipse
[Java] How to set the Date time to 00:00:00
[Rails] Assigning variables from controller to JavaScript
[Java] How to get the current directory
From installing Eclipse to executing Java (PHP)
Post to Slack from Play Framework 2.8 (Java)
Java: How to send values from Servlet to Servlet
How to install the legacy version [Java]
[Java] Flow from source code to execution
How to get the date in java
Output of the book "Introduction to Java"
[Processing × Java] How to use the function
Introduction to monitoring from Java Touching Prometheus
Precautions when migrating from VB6.0 to JAVA