When I started learning programming, my first language was C++. This was not an easy start, since you had to get used to pointers and references. In school/study I was taught Java, and I asked where the pointers are. I was told that Java doesn’t use pointers. This made it simple to me: I will now chose Java over C++. But there must be a reason why people ‘still’ use C/C++ and this was also easy: better control over the system, hardware access, low level stuff. So basically you can make a lot of damage with C++, if you don’t know exactly what you do, whereas in Java you have a Virtual Machine executing your code.
let test = 1; console.log(test); // prints '1' test = 'test'; console.log(test); // prints 'test'
test and then reassign it with the string ‘test’. That would not be possible in Java, since the language is statically typed. Statically typed means that a variable name is bound to a type and an object (or null). Dynamically typed means that a variable name is only bound to an object. So the main difference is that the binding between type and object happens at execution time, or already when compiling. There is also a difference between strongly and weekly typed languages. Compared to a weakly typed programming language, a strongly typed one simply does not allow the example above. Every developer should decide if he or she likes the kind of type system a language has. Often it is one of the most important facts when choosing a programming language. I, for my part was very very concerned about the type system. But in my opinion, a programming language is a tool to solve a problem or a need in general. If that means that I have to build a robot, I would probably not use Java for that case but rather C/C++ or Python, eventually Rust or GoLang.